Help - Search - Members - Calendar
Full Version: Title on top of thumbnails, views at the bottom
CyberiaPC.com Community > Technical Zone > Zenith Picture Gallery > Feature Requests, Add-ons and Mods
jhutch
Under my thumbnails, it now reads

QUOTE
Devin Hester
Added on: June 20, 2007
Comments: none
Views: 7 times


I would like for it to only show the Title and the number of views. How do I remove the others?
jhutch
My bad, just found it in the FAQs
jhutch
New question though. Now I have only the page views and title. Is there a way to move the title up above the thumbnail and leave the number of views below the thumbnail, but right below it (no line breaks)
jhutch
Ignore this question, I don't need an answer anymore. Thanks anyways
usr.c
Try this (this would've been much nicer were it not for the table cells...a future release hopefully):

In functions/f_search.php look for (in outputSearchResultsCell())

CODE
echo "<td width='$td_width%' class='pic_cell' valign='bottom'>
    <table width='100%' cellspacing='0' cellpadding='3'>
    <tr><td colspan='{$config['thumbs_perrow']}' align='center'>";
    showPic($config, $lang, $row, '0', '0');
    echo "</td></tr>";
    
    if($config['thumb_show_details'] == 1 || loggedIn($config)) {
        if($config['thumb_details_align'] == 0)   $thumb_details_align = "left";
        elseif($config['thumb_details_align'] == 1)   $thumb_details_align = "center";
        elseif($config['thumb_details_align'] == 2)   $thumb_details_align = "right";
        echo "<tr><td class='cell_highlight' align='$thumb_details_align' width='100%' "; if($config['page_direction'] == "1")   echo " dir='rtl'"; echo ">";
        $must_close = 1;
    }
    
    //conditional output of data in showEntry()
    if(mysql_field_name($result,3) == "r")   showEntry($lang, $row, $config, array("title","comments","rating"));
    elseif(mysql_field_name($result,1) == "comment_body")   showEntry($lang, $row, $config, array("comment_body","for_gods_sake_no_views"));
    //otherwise, show only the bits that the user wants shown
    //edit this to suit. array() <= {title, date, size, category, rating, comment_body, description}
    else   showEntry($lang, $row, $config, array("title","comments","date"));

and replace it with

CODE
echo "<td width='$td_width%' class='pic_cell' valign='bottom'>
    <table width='100%' cellspacing='0' cellpadding='3'>
    ";
    
    //title-on-top-views-at-the-bottom mod requested by jhutch (June 22, 2007)
    //get the alignment (was further down)
    if($config['thumb_show_details'] == 1 || loggedIn($config)) {
        if($config['thumb_details_align'] == 0)   $thumb_details_align = "left";
        elseif($config['thumb_details_align'] == 1)   $thumb_details_align = "center";
        elseif($config['thumb_details_align'] == 2)   $thumb_details_align = "right";
    }
    
    //show the title above the pic
    echo "<tr><td colspan='{$config['thumbs_perrow']}' align='$thumb_details_align' width='100%' "; if($config['page_direction'] == "1")   echo " dir='rtl'"; echo ">";
    if(mysql_field_name($result,3) != "r" && mysql_field_name($result,1) != "comment_body")   showEntry($lang, $row, $config, array("title", "for_gods_sake_no_views"));
    echo "</td></tr>
    ";
    
    echo "<tr><td colspan='{$config['thumbs_perrow']}' align='center'>";
    showPic($config, $lang, $row, '0', '0');
    echo "</td></tr>";
    
    if($config['thumb_show_details'] == 1 || loggedIn($config)) {
        echo "<tr><td class='cell_highlight' align='$thumb_details_align' width='100%' "; if($config['page_direction'] == "1")   echo " dir='rtl'"; echo ">";
        $must_close = 1;
    }
    
    //conditional output of data in showEntry()
    if(mysql_field_name($result,3) == "r")   showEntry($lang, $row, $config, array("title","comments","rating"));
    elseif(mysql_field_name($result,1) == "comment_body")   showEntry($lang, $row, $config, array("comment_body","for_gods_sake_no_views"));
    //otherwise, show only the bits that the user wants shown
    //edit this to suit. array() <= {title, date, size, category, rating, comment_body, description}
    else   showEntry($lang, $row, $config, array());

That should do it. If something dies, let me know.
jhutch
Thanks man, I appreciate your work, I will have to try it out.

PS - Tables suck, haha
jhutch
This worked PERFECT. Thanks.

How would I add the date added (with the page views) underneath the thumbnail
usr.c
Just change the last line to

CODE
else   showEntry($lang, $row, $config, array("date"));

Look in functions/f_global.php for the function showEntry() and inside it you'll find a block with all the possible fields you can specify in the line above that you want to show up.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.