|
Page 1 of 1
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 FAP CUSTOMIZATION - [MOD] Show Album Button in viewtopic
From: 9 Aug, 2005
Tom wrote: I've made a small add on for the "Full Album Pack", so the Gallery button is shown in viewtopic right next to the profile button if the user has a personal gallery.
Tell me, what you think...
##############################################################
## MOD Title: Show Album Button in viewtopic
## MOD Author: Galaxy21 < n/a > (Tom) n/a
## MOD Description:
## Adds a button with link to the user's personal gallery if he/she created one
## next to the user's profile button in viewtopic.
##
## MOD Version: 0.0.1
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## Files To Edit: (3)
## viewtopic.php
## language/lang_english/lang_main.php
## templates/subSilver/viewtopic_body.tpl
##
## Included Files: (n/a)
##
##############################################################
## Author Notes:
##
## o This Mod is an Extension of the Mighty Gorgon - Full Album Pack
##
##############################################################
## MOD History:
##
##
## 2005-08-10 - Version 1.0.0
## - first release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#
$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Galaxy21 - Show Album Button - BEGIN
$sql = 'SELECT count(*) AS pic_total
FROM ' . ALBUM_CAT_TABLE . ' AS c, ' . ALBUM_TABLE . ' AS p
WHERE c.cat_user_id = ' . $poster_id .'
AND p.pic_cat_id = c.cat_id';
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain album information', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$totalpicrow = $row;
}
$db->sql_freeresult($result);
if ( $totalpicrow['pic_total'] != 0 )
{
$temp_url = append_sid("album.$phpEx?user_id=$poster_id");
$album_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_album'] . '" alt="' . $lang['Show_Personal_Gallery'] . '" title="' . $lang['Show_Personal_Gallery'] . '" border="0" /></a>';
$album = '<a href="' . $temp_url . '">' . $lang['Show_Personal_Gallery'] . '</a>';
}
else
{
$album_img = '';
$album = '';
}
// Galaxy21 - Show Album Button - END
#
#-----[ FIND ]------------------------------------------------
#
#
'PROFILE' => $profile,
#
#-----[ AFTER, ADD ]-----------------------------------------
#
// Galaxy21 - Show Album Button - BEGIN
'ALBUM_IMG' => $album_img,
'ALBUM' => $album,
// Galaxy21 - Show Album Button - END
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
#
// That's all Folks!
#
#-----[ AFTER, ADD ]----------------------------------
#
// Galaxy21 - Show Album Button - BEGIN
$lang['Show_Personal_Gallery'] = 'Show personal gallery';
// Galaxy21 - Show Album Button - END
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
#
<td valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}<script language="JavaScript" type="text/javascript"><!--
#
#-----[ IN-LINE FIND ]----------------------------------------
#
{postrow.PROFILE_IMG}
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
{postrow.ALBUM_IMG}
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
|
#1 Mon 08 Jan, 2007 23:23 |
|
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
lefty74 
Joined: January 2007
Posts: 137
|
 Re: [MOD] Show Album Button In Viewtopic
Yeah, I like that one
I did a small addition to include the total numbers of pics in the title
#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#
$album_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_album'] . '" alt="' . $lang['Show_Personal_Gallery'] . '" title="' . $lang['Show_Personal_Gallery'] . '" border="0" /></a>';
#
#-----[ REPLACE WITH ]------------------------------------------------
#
$album_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_album'] . '" alt="' . $lang['Show_Personal_Gallery'] . ' ' . '[' . $totalpicrow['pic_total'] . ' ' . $lang['Pics'] . ']' . '" title="' . $lang['Show_Personal_Gallery'] . ' ' . '[' . $totalpicrow['pic_total'] . ' ' . $lang['Pics'] . ']' . '" border="0" /></a>';
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
#
$lang['Show_Personal_Gallery'] = 'Show personal gallery';
#
#-----[ AFTER, ADD ]----------------------------------
#
$lang['Pics'] = 'Pics';
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
Edited by KugeLSichA, Tue 09 Jan, 2007 05:11: added the pics count also in the ALT tag |
#2 Tue 09 Jan, 2007 00:54 |
|
KugeLSichA 
Joined: August 2006
Posts: 803
Location:  Dresden
|
 Re: [MOD] Show Album Button in viewtopic
lefty74,
thx for sharing your addon.
but you should also include the pics count in the ALT tag
I have done this in your post
|
#3 Tue 09 Jan, 2007 05:10 |
|
lefty74 
Joined: January 2007
Posts: 137
|
 Re: [MOD] Show Album Button In Viewtopic
Thanks KugelSichA,
although personally I wanted this additional information for the tool tip, not the alt text
Up to individual preference I guess
|
#4 Tue 09 Jan, 2007 18:21 |
|
krisbfunk 
Joined: December 2006
Posts: 95
Location:
|
 Re: [MOD] Show Album Button In Viewtopic
great little mod guys!
|
#5 Fri 19 Jan, 2007 06:13 |
|
KugeLSichA 
Joined: August 2006
Posts: 803
Location:  Dresden
|
 [MOD] Show Album Button in viewtopic IP Version
Hello,
I Like this MOD and have added it now to my forum, but i did some changes and deleted some line because they don´t need to be added...
You also dont need to add a new line in lang_main.php, because I use the "sprintf" line which is already in the lang_main.php
#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#
$profile = '<a href="' . $temp_url . '">' . $lang['Profile'] . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$sql = 'SELECT count(*) AS pic_total
FROM ' . ALBUM_CAT_TABLE . ' AS c, ' . ALBUM_TABLE . ' AS p
WHERE c.cat_user_id = ' . $poster_id .'
AND p.pic_cat_id = c.cat_id';
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain album information', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$totalpicrow = $row;
}
$db->sql_freeresult($result);
if ( $totalpicrow['pic_total'] != 0 )
{
$temp_url = append_sid('album.' . $phpEx . '?user_id=' . $poster_id);
$album_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_album'] . '" alt="' . sprintf($lang['Personal_Gallery_Of_User_Profile'], $postrow[$i]['username'], $totalpicrow['pic_total']) . '" title="' . sprintf($lang['Personal_Gallery_Of_User_Profile'], $postrow[$i]['username'], $totalpicrow['pic_total']) . '" border="0" /></a>';
$album = '<a href="' . $temp_url . '">' . $lang['Show_Personal_Gallery'] . '</a>';
}
else
{
$album_img = '';
$album = '';
}
#
#-----[ FIND & DELETE ]------------------------------------------------
#
// --- Smart Album Button BEGIN ----------------
// added by Tom XS2 Build 054
if ( $postrow[$i]['user_personal_pics_count'] > 0 )
{
$album_img = ( $postrow[$i]['user_personal_pics_count'] ) ? '<a href="album.php?user_id=' . $postrow[$i]['user_id'] . '"><img src="' . $images['icon_album'] . '" alt="' . $lang['Show_Personal_Gallery'] . '" title="' . $lang['Show_Personal_Gallery'] . '" border="0" /></a>' : '';
$album = ( $postrow[$i]['user_personal_pics_count'] ) ? '<a href="album.php?user_id=' . $postrow[$i]['user_id'] . '">' . $lang['Show_Personal_Gallery'] . '</a>' : '';
}
else
{
$album_img = '';
$album = '';
}
// --- Smart Album Button END ----------------
#
#-----[ OPEN ]------------------------------------------------
#
templates/.../viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
#
<!-- END switch_user_admin_or_mod -->
</center>
</td>
<td class="row-post-buttons post-buttons">
<div style="text-align: right">
<div style="position: relative; float: left; text-align: left;">
#
#-----[ IN-LINE FIND ]----------------------------------------
#
{postrow.PROFILE_IMG}
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
{postrow.ALBUM_IMG}
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
Demo how it looks you will see here
|
#6 Sat 20 Jan, 2007 13:21 |
|
HammerBe 
Joined: April 2007
Posts: 17
Location:  berlin
|
 Re: [MOD] Show Album Button In Viewtopic
if I know thereby number of pictures erhoehn, 5-10 pictures and is it would like to let indicate possible over ACP the attitudes to be made.
kann ich damit anzahl der bilder erhöhn,möchte 5-10 bilder anzeigen lassen. und ist es möglich über ACP die einstellungen zu machen.
OOOO sorry i wolld this for portal.php
|
#7 Mon 19 Nov, 2007 20:47 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|