PhotoPlog

PhotoPlog (http://www.photoplog.com/forum/index.php)
-   "How Do I..." Questions (http://www.photoplog.com/forum/forumdisplay.php?f=7)
-   -   How to add 4 random images to my sidebar? (http://www.photoplog.com/forum/showthread.php?t=355)

AdyumS 06-26-2006 12:11 AM

How to add 4 random images to my sidebar?
 
I am using this sidebar hack and was wondering how I could implement 4 random thumbnails from my gallery to this sidebar. Any insite?

Morgan 06-28-2006 01:15 AM

Untested, but perhaps use this: remove the last eval line from the PHP file and place the remaining PHP atop the Right Column plugin using the global_start hook, and then add the following variable to the right_column template:
Code:

$photoplog_thumbs_vert

arowana 05-01-2007 03:55 AM

Quote:

place the remaining PHP atop the Right Column plugin using the global_start hook
hi.i'm using template edits for a right column on my forumhome.how do insert vertical thumbs in my templates?i do not have the side column hack installed,no global_start hook to edit your above instructions.

Morgan 05-01-2007 02:48 PM

Again untested, but try this: remove the last eval line from the PHP file and place the remaining PHP in a plugin using the global_start hook, and then add the following variable to the template containing the right column you made:
Code:

$photoplog_thumbs_vert
To add a plugin, go to the vB ACP -> Plugins & Products -> Add New Plugin.
For further details on how to add a plugin, check here.

AnabolicResourc 03-06-2008 07:32 AM

Works for me !

mrjangles 03-11-2008 08:45 PM

This is not working for me. I'm not trying to incorperate it to another plugin, just include it on the site in my custom nav. I follow the same process to create a plugin.

I've removed the line and get the following error:
Parse error: parse error, unexpected '>' in /sitehere.com/includes/functions.php(5166) : eval()'d code on line 48

Any ideas? =\

Morgan 03-12-2008 09:29 AM

Whatever you used for the plugin is incorrect:
Quote:

Originally Posted by mrjangles (Post 16077)
... Parse error: parse error, unexpected '>' in /sitehere.com/includes/functions.php(5166) : eval()'d code on line 48 ...

Look at the plugin's PHP code and try removing the > character.

mrjangles 03-12-2008 02:52 PM

This is the code i'm using. I can't find anything wrong with it.

Code:

if (!defined('VB_AREA') || !defined('THIS_SCRIPT') || !defined('DIR'))
{
        exit();
}

$photoplog_cnt_bits = 0;

if ($permissions['photoplogpermissions'] & $vbulletin->bf_ugp_photoplogpermissions['photoplogcanviewfiles'])
{
        $photoplog_location = $vbulletin->options['photoplog_script_dir'];

        $photoplog_file_infos = $db->query_read("SELECT *
                                                FROM photoplog_fileuploads
                                                WHERE moderate = 0
                                                ORDER BY RAND()
                                                LIMIT 5
        ");

        $photoplog_table_content = '';

        while ($photoplog_file_info = $db->fetch_array($photoplog_file_infos))
        {
                $photoplog_cnt_bits++;

                $photoplog_fileid = $photoplog_file_info['fileid'];
                $photoplog_userid = $photoplog_file_info['userid'];
                $photoplog_username = $photoplog_file_info['username'];

                $photoplog_table_content .= "
                <tr>
                        <td class=\"alt2\" align=\"center\">
                                <a href=\"".$photoplog_location."/index.php?".$vbulletin->session->vars

['sessionurl']."n=".$photoplog_fileid."\">
                                        <img src=\"".$photoplog_location."/file.php?".$vbulletin->session->vars

['sessionurl']."n=".$photoplog_fileid."&amp;w=s\" border=\"0\" />
                                </a>
                        </td>
                </tr>
                <tr>
                        <td class=\"alt2\" align=\"center\">
                                <div class=\"smallfont\">
                                        ".$vbphrase['posted_by']." <a href=\"".$photoplog_location."/index.php?".$vbulletin-

>session->vars['sessionurl']."u=".$photoplog_userid."\">".$photoplog_username."</a>
                                </div>
                        </td>
                </tr>
                ";
        }

        $db->free_result($photoplog_file_infos);

        $photoplog_table_start = "<table border=\"0\" cellpadding=\"".$stylevar['cellpadding']."\" cellspacing=\"".$stylevar

['cellspacing']."\" align=\"center\">";
        $photoplog_table_end = "</table>";

        $photoplog_thumbs_vert = $photoplog_table_start.$photoplog_table_content.$photoplog_table_end;
}

if (!$photoplog_cnt_bits)
{
        $photoplog_thumbs_vert = '&nbsp;';
}

I was using the global_complete hook. Not sure if it makes a difference, but now it's under global_start. I'm not getting an error, but when I call $photoplog_thumbs_vert in a template, no images are displayed. This isnt the only plugin doing this. The 1337 thumbs hack for photoplog is doing the same thing. I install it correctly, but when I make the call, nothing is displayed. Very strange. I'm using the latest VB with patch2.

Thanks again for the help.

Morgan 03-12-2008 05:12 PM

Remove those strange newlines from the PHP code, or do another copy-paste. You cannot have things like the following in code:
Code:

$variable-
>whatever

$variable
['whatever']


mrjangles 03-12-2008 06:12 PM

I'll give that a try. For example:

$vbulletin->session->vars['sessionurl']
$vbulletin['sessionurl']

Like that?

FYI: The code is directly from the link in this thread, unedited.


All times are GMT. The time now is 08:43 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.