PhotoPlog

PhotoPlog (http://www.photoplog.com/forum/index.php)
-   "How Do I..." Questions (http://www.photoplog.com/forum/forumdisplay.php?f=7)
-   -   Memberinfo question (http://www.photoplog.com/forum/showthread.php?t=69)

Mythotical 02-10-2006 09:36 AM

Memberinfo question
 
Ok I added:
Code:

$photoplog_memberinfo
To the memberinfo template but its not working at all. Now what I would like is for it to display their last 5 pics submitted to the gallery. How would I do that and maybe you can tell me why the code above isn't working for me.

My memberinfo template is highly customised using the MySpace look alike profile view.

Thanks in advance
Steve

Morgan 02-11-2006 01:11 PM

Check that the 'can view files' usergroup permission is set to yes, and that there are uploaded files for that particular user, none of which are in file moderation. I'm not familiar with the MySpace look-alike profile view, but if it's only modifying a template, it shouldn't affect the variable. If you want to display latest thumbs instead of random thumbs, you'd need to edit the query in the PhotoPlog Member Info Thumbs plugin.

Mythotical 02-12-2006 03:52 AM

Morgan, here is the funny thing, all permissions are set to viewable defaults, anyone can view files, etc.

Its odd, I know that is has nothing to do with the template so maybe its the code. I will have it posted below that way you can check to make sure I didn't accidentally change anything.

PhotoPlog Member Info:
Code:

// photoplog_memberinfo
$photoplog_location = eregi_replace("[/]$","",$vbulletin->options['homeurl']).$vbulletin->options['photoplog_script_dir'];

$photoplog_file_infos = $db->query_read("SELECT * FROM photoplog_fileuploads WHERE userid = ".intval($userinfo['userid'])." ORDER BY RAND() LIMIT 5");

$photoplog_cnt_bits = 0;
$photoplog_row_table = '';

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

        $photoplog_fileid = $photoplog_file_info['fileid'];

        $photoplog_row_table .= "
<td class=\"alt2\" align=\"center\" width=\"20%\"><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>
        ";
}

$db->free_result($photoplog_file_infos);

$photoplog_table_start = "<table class=\"tborder\" border=\"0\" cellpadding=\"".$stylevar['cellpadding']."\" cellspacing=\"".$stylevar['cellspacing']."\" align=\"center\" width=\"100%\"><tr>
<td colspan=\"5\" class=\"thead\"><a style=\"float: ".$stylevar['right'].";\" href=\"#top\" onclick=\"return toggle_collapse('photoplog_memberinfo')\"><img id=\"collapseimg_photoplog_memberinfo\" src=\"".$stylevar['imgdir_button']."/collapse_thead".$vbcollapse['collapseimg_photoplog_memberinfo'].".gif\" alt=\"\" border=\"0\" /></a></td>
</tr><tbody id=\"collapseobj_photoplog_memberinfo\" style=\"".$vbcollapse['collapseobj_photoplog_memberinfo']."\"><tr>";

$photoplog_table_end = "</tr></tbody></table><br />";

$photoplog_memberinfo = $photoplog_table_start.$photoplog_row_table.$photoplog_table_end;

if (!$photoplog_cnt_bits)
{
        $photoplog_memberinfo = '';
}
// photoplog_memberinfo

PhotoPlog Member Info Thumbs:
Code:

// PhotoPlog

// edit the MEMBERINFO template, placing $photoplog_memberinfo
// right after $navbar appears in the template and save

$photoplog_cnt_bits = 0;

if ($permissions['photoplogpermissions'] & $vbulletin->bf_ugp_photoplogpermissions['photoplogcanviewfiles'])
{
        $photoplog_homeurl = parse_url($vbulletin->options['homeurl']);
        $photoplog_schemehost = $photoplog_homeurl['scheme'].'://'.$photoplog_homeurl['host'];
        $photoplog_location = $photoplog_schemehost.$vbulletin->options['photoplog_script_dir'];

        $photoplog_file_infos = $db->query_read("SELECT *
                                                FROM photoplog_fileuploads
                                                WHERE userid = ".intval($userinfo['userid'])."
                                                AND moderate = 0
                                                ORDER BY RAND()
                                                LIMIT 5
        ");

        $photoplog_row_table = '';

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

                $photoplog_fileid = $photoplog_file_info['fileid'];

                $photoplog_row_table .= "
                <td class=\"alt2\" align=\"center\" width=\"20%\">
                        <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>
                ";
        }

        $db->free_result($photoplog_file_infos);

        $photoplog_table_start = "<table class=\"tborder\" border=\"0\" cellpadding=\"".$stylevar['cellpadding']."\" cellspacing=\"".$stylevar['cellspacing']."\" align=\"center\" width=\"100%\"><tr>
        <td colspan=\"5\" class=\"thead\"><a style=\"float: ".$stylevar['right'].";\" href=\"#top\" onclick=\"return toggle_collapse('photoplog_memberinfo')\"><img id=\"collapseimg_photoplog_memberinfo\" src=\"".$stylevar['imgdir_button']."/collapse_thead".$vbcollapse['collapseimg_photoplog_memberinfo'].".gif\" alt=\"\" border=\"0\" /></a>".$vbphrase['photoplog_random_thumbs']."</td>
        </tr><tbody id=\"collapseobj_photoplog_memberinfo\" style=\"".$vbcollapse['collapseobj_photoplog_memberinfo']."\"><tr>";

        $photoplog_table_end = "</tr></tbody></table><br />";

        $photoplog_memberinfo = $photoplog_table_start.$photoplog_row_table.$photoplog_table_end;
}

if (!$photoplog_cnt_bits)
{
        $photoplog_memberinfo = '';
}

// PhotoPlog

I don't think anything is changed but I could have added something on accident or the site owners partner could have changed something.


Also, could I change this line:
PHP Code:

    $photoplog_file_infos $db->query_read("SELECT *
                        FROM photoplog_fileuploads
                        WHERE userid = "
.intval($userinfo['userid'])."
                        AND moderate = 0
                        ORDER BY RAND()
                        LIMIT 5 

To:
PHP Code:

    $photoplog_file_infos $db->query_read("SELECT *
                        FROM photoplog_fileuploads
                        WHERE userid = "
.intval($userinfo['userid'])."
                        AND moderate = 0
                        ORDER BY ASC()
                        LIMIT 5 

That way it will get the last 5 and sort them ascending?

Cheers and thanks for the help
Steve

Morgan 02-13-2006 01:25 PM

Don't see anything that stands out. Did the hook get changed? Try adding in some echo statements and see what shows on screen. To order by time use:
Code:

ORDER BY dateline DESC

Mythotical 02-14-2006 04:23 AM

Still can't get them to show. Let me post a screenshot.

http://img.photobucket.com/albums/v2...al/screeny.jpg

Don't ask me why its doin that as I tried figuring it out but decided it best to ask here.

Morgan 02-14-2006 12:49 PM

That almost looks like the SRC links to the thumbs are incorrect:
Code:

$photoplog_location = eregi_replace("[/]$","",$vbulletin->options['homeurl']).$vbulletin->options['photoplog_script_dir'];
View the HTML source and see what links are in the red box area.

Mythotical 02-15-2006 01:34 AM

LOL, found the problem:
Code:

<td valign="top">
<table class="tborder" border="0" cellpadding="6" cellspacing="1" align="center" width="100%"><tr>
<td colspan="5" class="thead"><a style="float: right;" href="#top" onclick="return toggle_collapse('photoplog_memberinfo')"><img id="collapseimg_photoplog_memberinfo" src="heavyhitters/buttons/collapse_thead.gif" alt="" border="0" /></a></td>
</tr><tbody id="collapseobj_photoplog_memberinfo" style=""><tr>
<td class="alt2" align="center" width="20%"><a href="http://www.oneworldonehood.com/forum/forum/photoplog/index.php?n=206">
<img src="http://www.oneworldonehood.com/forum/forum/photoplog/file.php?n=206&amp;w=s" border="0" /></a>
</td>
       
<td class="alt2" align="center" width="20%"><a href="http://www.oneworldonehood.com/forum/forum/photoplog/index.php?n=205">
<img src="http://www.oneworldonehood.com/forum/forum/photoplog/file.php?n=205&amp;w=s" border="0" /></a>
</td>
       
<td class="alt2" align="center" width="20%"><a href="http://www.oneworldonehood.com/forum/forum/photoplog/index.php?n=204">
<img src="http://www.oneworldonehood.com/forum/forum/photoplog/file.php?n=204&amp;w=s" border="0" /></a>
</td>
       
<td class="alt2" align="center" width="20%"><a href="http://www.oneworldonehood.com/forum/forum/photoplog/index.php?n=203">

<img src="http://www.oneworldonehood.com/forum/forum/photoplog/file.php?n=203&amp;w=s" border="0" /></a>
</td>
       
<td class="alt2" align="center" width="20%"><a href="http://www.oneworldonehood.com/forum/forum/photoplog/index.php?n=202">
<img src="http://www.oneworldonehood.com/forum/forum/photoplog/file.php?n=202&amp;w=s" border="0" /></a>
</td>

Its calling the forum folder twice when it should only do that once. Interesting.

Mythotical 02-15-2006 01:42 AM

Now its fixed. Looks like its posting the last 5 instead of the random part. Thanks for the help.


All times are GMT. The time now is 01:13 PM.

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