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.

AWMGolfer 03-15-2008 12:00 AM

Works great!! Thank you!!

ChurchMedia 03-15-2008 12:00 AM

Thanks, Spingo! I'd like to make the albums as full featured as possible since I run a community that does graphics for a living. I hope to see an album search mod sometime (I'm too lazy to write one).

This is a great mod to a great mod! :)

rolandogomez 03-15-2008 12:50 AM

Cool Spingo! Now how do we make the user's name link to their profile (grin) That would be cool. And to that, if when selecting an album to view, add the album owner's name and link too along with when viewing a photo, something, like "go to user's profile" or "go to all albums by X user." Especially for us non-php types. Thanks, rg sends!

Spingo 03-15-2008 12:56 AM

Well, you can quickly link to the profile of the album author by editing the all_albumbit template and changing:
Code:

$album[username]
to:
Code:

<a href="member.php?$session[sessionurl]u=$album[userid]">$album[username]</a>
You can tweak the template a bit more if you want to link to other albums by that user - it's the same as above but in this case, you'd link to album.php instead of member.php.

I'm currently fiddling with getting avatars to display too, but I might have to come back to this later as I'm about to head out...

rolandogomez 03-15-2008 03:20 AM

Quote:

Originally Posted by Spingo (Post 1465018)
Well, you can quickly link to the profile of the album author by editing the all_albumbit template and changing:
Code:

$album[username]
to:
Code:

<a href="member.php?session[sessionurl]u=$album[userid]">$album[username]</a>
You can tweak the template a bit more if you want to link to other albums by that user - it's the same as above but in this case, you'd link to album.php instead of member.php.

I'm currently fiddling with getting avatars to display too, but I might have to come back to this later as I'm about to head out...

The rest worked, but this change too me to a page that said, "This user has not registered and therefore does not have a profile to view." on every username I clicked on, the url shows up like this, http://www.shotcritic.com/forums/member.php?session[sessionurl]u=25 and for some reason that don't look right.

So I played, as I don't know what I'm doing, what I found worked was this code,
Code:

<a href="member.php?u=$album[userid]">$album[username]'s<br> Profile</a><hr noshade width="50">
                <a href="album.php?u=$album[userid]"> Albums</a>

Which generates this page on my site, http://www.shotcritic.com/forums/all_albums.php

I would like to know how to "de-link" the user's name so only the "Profile" and "Albums" links are visible and I'd like to color the font too for the album owner's name (username) I just am not that good as I'm no coder, this was pure luck.

No what would be cool, when folks click on the albums' names and it takes you to that album, if on that page, the albums.php page, that would have that album owners name and link to their profile.

Thanks, rg sends!

Savage702 03-15-2008 05:54 AM

Thank you so much Spingo!! Awesome additions!!!

Spingo 03-15-2008 10:02 PM

Quote:

Originally Posted by rolandogomez (Post 1465080)
The rest worked, but this change too me to a page that said, "This user has not registered and therefore does not have a profile to view."

I have edited the above post with the all important but missing "$" before "session".

rolandogomez 03-15-2008 11:29 PM

Quote:

Originally Posted by Spingo (Post 1465689)
I have edited the above post with the all important but missing "$" before "session".

So I don't screw it up, what do I change in this code
Code:

<a href="member.php?u=$album[userid]">$album[username]'s<br> Profile</a><hr noshade width="50">
                <a href="album.php?u=$album[userid]"> Albums</a>

so I can keep the user's profile and albums links, also how do I de-link the user's name itself, i.e.,

User's Name (not link)
Profile (linked as in my URL below)
____

Albums (linked as in my URL below)

See how this code displays it on my site now,
http://www.shotcritic.com/forums/all_albums.php

Thanks, rg sends!

Abe1 03-16-2008 01:58 AM

Version 2.0 (03/15/08):
  • Product MUST be installed now.
  • Shows username
  • Phrases are normal now.

Adem GEN? 03-16-2008 10:24 AM

Thanks

7lanet 03-16-2008 04:43 PM

Thank you, my dear, for this achievement
Have a suggestion:

Non-appearance of albums that do not contain images
Album governing option introduced a vertical or horizontal
And making the most of each row album seems nicer appearance .

antiekeradio 03-16-2008 07:43 PM

very cool! gives the albums functionality in 3.7 a functional boost!

install went easy, works 100%. top plugin.

rolandogomez 03-17-2008 02:49 AM

Does anyone know how we can add album views? And even how many times a photo has been viewed? Thanks, rg sends!

Savage702 03-17-2008 04:09 AM

I'd like to know if there is a way to view if a photo has comments in an album, rather than having to look at each picture to see comments. Album views like Rolando said too... heck, Picture views too...

TaBaTaN 03-17-2008 12:46 PM

really nice, installed
_________________
http://www.netplay.com.ar

bryanb 03-17-2008 02:35 PM

Thanks Abe1!! Great mod! My members were asking for something like this just today, and here it is. :)

Quote:

Originally Posted by 7lanet (Post 1466263)
Non-appearance of albums that do not contain images.

Quote:

Originally Posted by Savage702 (Post 1466738)
I'd like to know if there is a way to view if a photo has comments in an album, rather than having to look at each picture to see comments.

These would be most helpful. Also, Is there a way to sort these by user name? That would be great too.

Looks like we want to keep you busy :D

Abe1 03-18-2008 11:18 AM

I'll see what I can do guys.

theOZer 03-19-2008 09:44 PM

Running vB3.7.0 RC1.
Installed My Albums V2.0.
When I click on 'All Albums' off the navbar, I do indeed see all user albums but under the Pictures columns all have 0 (zero) pictures.

SgtTechHead 03-19-2008 11:18 PM

Quote:

Originally Posted by theOZer (Post 1469141)
Running vB3.7.0 RC1.
Installed My Albums V2.0.
When I click on 'All Albums' off the navbar, I do indeed see all user albums but under the Pictures columns all have 0 (zero) pictures.

This is due to the file "all_albums.php" checking for the version of vBulletin. This code in particular:

Code:

if (version_compare($vbulletin->options['templateversion'], '3.7.0 Alpha 6', '<'))
{
  $album['picturecount'] = vb_number_format($album['picturecount']);
}
else
{
  $album['picturecount'] = vb_number_format($album['visible']);
}

I commented the following lines out of that section so that it only uses "vb_number_format($album['visible'])":

Code:

// if (version_compare($vbulletin->options['templateversion'], '3.7.0 Alpha 6', '<'))
// {
//  $album['picturecount'] = vb_number_format($album['picturecount']);
// }
// else
// {
    $album['picturecount'] = vb_number_format($album['visible']);
// }

I assume the version check was there because the field names were changing from version to version. My fix may not be pretty, but it does work :)

Abe1 03-20-2008 02:46 AM

Quote:

Originally Posted by SgtTechHead (Post 1469206)
This is due to the file "all_albums.php" checking for the version of vBulletin. This code in particular:

Code:

if (version_compare($vbulletin->options['templateversion'], '3.7.0 Alpha 6', '<'))
{
  $album['picturecount'] = vb_number_format($album['picturecount']);
}
else
{
  $album['picturecount'] = vb_number_format($album['visible']);
}

I commented the following lines out of that section so that it only uses "vb_number_format($album['visible'])":

Code:

// if (version_compare($vbulletin->options['templateversion'], '3.7.0 Alpha 6', '<'))
// {
//  $album['picturecount'] = vb_number_format($album['picturecount']);
// }
// else
// {
    $album['picturecount'] = vb_number_format($album['visible']);
// }

I assume the version check was there because the field names were changing from version to version. My fix may not be pretty, but it does work :)

I came up with a better way. Check my new update in a few min.

Abe1 03-20-2008 02:49 AM

Version 2.1 (03/19/08):
  • PHP file only.
  • Fixed Image count if you have vb3.7.0 RC 1.

SgtTechHead 03-20-2008 11:12 AM

Quote:

Originally Posted by Abe1 (Post 1469299)
I came up with a better way. Check my new update in a few min.

Thanks for the update ;)

Gemma 03-20-2008 11:22 AM

Thanks for the update :)

theOZer 03-20-2008 02:14 PM

Abe1,
V2.1 in vB370RC1 nows shows the picture counts. Thank you!
This mod adds a valuable feature to vB370. I'm glad you wrote it.
I look forward to any and all further embellishment you may make to this mod.
~OZ

MrToasty 03-21-2008 07:57 AM

Installed when you first released, and I'm very impressed with the timely updates through the beta stages. You rock! :)

Abe1 03-21-2008 12:27 PM

Version 2.2 (03/21/08):
  • Cache Templates
  • Fixed some issues with extra queries running.
  • Added "Add Album" links.
  • album_all_album_list template updated.
  • File updated.

Zebra 03-21-2008 01:00 PM

Great, fast update! Works good..

Adem GEN? 03-21-2008 04:14 PM

Thanks

furst 03-21-2008 04:37 PM

Nice update. Thanks for adding the add button.

This may be outside the scope of what you have planned for this mod, but is there any chance of adding a top stats-esque box near the top that would show a certain number of the most recent comments in all albums? I feel that there is a need to highlight the activity that goes on in the albums, as currently only the album owner is made aware of new comments.

TaBaTaN 03-21-2008 04:38 PM

updated. Thank you.
Very nice hack


All times are GMT. The time now is 11:15 PM.

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.03273 seconds
  • Memory Usage 1,891KB
  • 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
  • (14)bbcode_code_printable
  • (12)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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