vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Social Group and Album Enhancements - All Albums (https://vborg.vbsupport.ru/showthread.php?t=172215)

JazzleBug 03-10-2008 04:32 AM

Good stuff. Super simple, but good stuff. Thanks!

furst 03-10-2008 03:41 PM

It would be nice if the Add Album button was on all_albums.php too.

KingAdora 03-12-2008 11:53 PM

Great script, would also love to see the 'add' link included, and also be able to see the username for the album - which clicks to the user profile.

Great job, keep it up :D

7lanet 03-13-2008 01:25 AM

Can you add another established by the Photo Album Members of the Home of the Forum?

katilkuzu 03-13-2008 08:33 AM

Quote:

Originally Posted by 7lanet (Post 1463453)
Can you add another established by the Photo Album Members of the Home of the Forum?

yeah really good idea, i need also something like

BBF 03-13-2008 09:45 AM

thanks for this one :)

only one little problem:

change

PHP Code:

    $navbits construct_navbits(array(
        
'all_albums.php' $vbulletin->session->vars['sessionurl_q'] => construct_phrase($vbphrase['xs_profile'], $userinfo['username']),
        
'' => $vbphrase['albums']
    )); 

to:

PHP Code:

        $navbits construct_navbits(array(
        
'all_albums.php' $vbulletin->session->vars['sessionurl_q'] => construct_phrase($vbphrase['xs_albums'], $userinfo['username']),
        
'' => $vbphrase['albums']
    )); 


rolandogomez 03-13-2008 12:54 PM

Quote:

Originally Posted by BBF (Post 1463676)
thanks for this one :)

only one little problem:

change

PHP Code:

    $navbits construct_navbits(array(
        
'all_albums.php' $vbulletin->session->vars['sessionurl_q'] => construct_phrase($vbphrase['xs_profile'], $userinfo['username']),
        
'' => $vbphrase['albums']
    )); 

to:

PHP Code:

        $navbits construct_navbits(array(
        
'all_albums.php' $vbulletin->session->vars['sessionurl_q'] => construct_phrase($vbphrase['xs_albums'], $userinfo['username']),
        
'' => $vbphrase['albums']
    )); 


What does this do? Do we have to change this in the php file? Thanks, rg.

Abe1 03-14-2008 01:24 AM

Quote:

Originally Posted by BBF (Post 1463676)
thanks for this one :)

only one little problem:

change

PHP Code:

    $navbits construct_navbits(array(
        
'all_albums.php' $vbulletin->session->vars['sessionurl_q'] => construct_phrase($vbphrase['xs_profile'], $userinfo['username']),
        
'' => $vbphrase['albums']
    )); 

to:

PHP Code:

        $navbits construct_navbits(array(
        
'all_albums.php' $vbulletin->session->vars['sessionurl_q'] => construct_phrase($vbphrase['xs_albums'], $userinfo['username']),
        
'' => $vbphrase['albums']
    )); 


Thanks. Will be in next version.

Enclave 03-14-2008 09:19 AM

Quote:

Originally Posted by rolandogomez (Post 1463777)
What does this do? Do we have to change this in the php file? Thanks, rg.

No you don't have to, that is in the product!

Spingo 03-14-2008 11:41 PM

1 Attachment(s)
It's not too difficult to customise this add-on to provide User Names with each Album, but as the Author has said, these modiications turn the mod into more of a "product" than simply adding a simple PHP file. I have done the following modifications in order to accomplish this on one of my sites (and the author may feel free to use any of this code to provide this feature if he/she so wishes):

In all_albums.php, change:
PHP Code:

    $albums $db->query_read("
        SELECT album.*,
            picture.pictureid, picture.extension, picture.idhash,
            picture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height,
        FROM " 
TABLE_PREFIX "album AS album
        LEFT JOIN " 
TABLE_PREFIX "picture AS picture ON (album.coverpictureid = picture.pictureid AND picture.thumbnail_filesize > 0)
        WHERE album.state IN ('" 
implode("', '"$state) . "')
        ORDER BY album.lastpicturedate DESC
        LIMIT 
$start$perpage
    "
); 

to:
PHP Code:

    $albums $db->query_read("
        SELECT album.*,
            picture.pictureid, picture.extension, picture.idhash,
            picture.thumbnail_dateline, picture.thumbnail_width, picture.thumbnail_height,
            user.username
        FROM " 
TABLE_PREFIX "album AS album
        LEFT JOIN " 
TABLE_PREFIX "picture AS picture ON (album.coverpictureid = picture.pictureid AND picture.thumbnail_filesize > 0)
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON (album.userid = user.userid)
        WHERE album.state IN ('" 
implode("', '"$state) . "')
        ORDER BY album.lastpicturedate DESC
        LIMIT 
$start$perpage
    "
); 

Next, change:
PHP Code:

            eval('$albumbits .= "' fetch_template('albumbit') . '";'); 

to:
PHP Code:

            eval('$albumbits .= "' fetch_template('all_albumbit') . '";'); 

and then, change:
PHP Code:

    eval('print_output("' fetch_template('album_list') . '");'); 

to:
PHP Code:

    eval('print_output("' fetch_template('all_album_list') . '");'); 

Next, go into Style Manager in the admincp and copy the contents of the albumbit template into a new template and call it all_albumbit. Then copy the contents of the album_list template into a new template called all_album_list. For there, you can edit these two new templates to add a User Name column. For instance, in all_album_list, I have changed:
Code:

<tr>
        <td class="thead">Thumbnail</td>
        <td class="thead" width="80%">$vbphrase[album_title]</td>
        <td class="thead" width="5%" align="center">$vbphrase[pictures]</td>
        <td class="thead" width="15%" nowrap="nowrap">$vbphrase[last_picture]</td>
</tr>

to:
Code:

<tr>
        <td class="thead">Thumbnail</td>
        <td class="thead" width="80%">$vbphrase[album_title]</td>
        <td class="thead">Author</td>
        <td class="thead" width="5%" align="center">$vbphrase[pictures]</td>
        <td class="thead" width="15%" nowrap="nowrap">$vbphrase[last_picture]</td>
</tr>

and in all_albumbit, I have changed:
Code:

                <div class="smallfont">
                        $album[description_html]
                        <if condition="$show['personalalbum']"><span class="shade">$albumtype</span></if>
                </div>
        </td>
        <td class="alt1" valign="middle" align="center">$album[picturecount]</td>
        <td class="alt2" valign="middle" nowrap="nowrap">

to:
Code:

                <div class="smallfont">
                        $album[description_html]
                        <if condition="$show['personalalbum']"><span class="shade">$albumtype</span></if>
                </div>
        </td>
        <td class="alt2" valign="middle" align="center">
                $album[username]
        </td>
        <td class="alt1" valign="middle" align="center">$album[picturecount]</td>
        <td class="alt2" valign="middle" nowrap="nowrap">

After some tidying up with the class tags (so as to make the colour alternate as intended, I have a pretty good looking result, as shown in the attachment.

Of course, you could customise the order of the columns if you'd like, or even add avatars to the user name without too much difficulty.

I should say that I whipped this mod up in about 15 minutes - so the usual caveat applies - I take no responsibility if something goes awry and it's possible that the code in all_almbums.php after my modifications could require some additional optimisation (specifically, I have not benchmarked what impact my additional JOIN has on the SQL side of things).

Enjoy.


All times are GMT. The time now is 03:32 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01501 seconds
  • Memory Usage 1,797KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (12)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete