Icy Phoenix

     
 


This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies. 
Page 1 of 1
 
 
Reply with quote Download Post 
Post 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...  

Code: [Download] [Hide] [Select]
##############################################################
## 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

 



 
ArtieSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post 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


Code: [Download] [Hide] [Select]
#
#-----[ 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'] . '&nbsp;' . '[' . $totalpicrow['pic_total'] . '&nbsp;' . $lang['Pics'] . ']' . '" title="' . $lang['Show_Personal_Gallery'] . '&nbsp;' . '[' . $totalpicrow['pic_total'] . '&nbsp;' . $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
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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  
 



 
lefty74Send private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [MOD] Show Album Button In Viewtopic 
 
great little mod guys!
 



 
krisbfunkSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post [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

Code: [Download] [Hide] [Select]
#
#-----[ 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
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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
 



 
HammerBeSend private message  
Back to topPage bottom
This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies.  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
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