vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBgarage (https://vborg.vbsupport.ru/forumdisplay.php?f=104)
-   -   vBGarage Latest Uploads on ForumHome for 4.x.x (https://vborg.vbsupport.ru/showthread.php?t=76382)

noppid 02-15-2005 10:02 PM

vBGarage Latest Uploads on ForumHome for 4.x.x
 
This is to display the five latest uploaded pictures to vBG on forumhome just like in the list on the vBGarage.php page.

Backup your database and files before doing any hack work!

In Forumhome index.php

Find ...
PHP Code:

// pre-cache templates used by all actions
$globaltemplates = array(
    
'FORUMHOME',
    
'forumhome_event',
    
'forumhome_forumbit_level1_nopost',
    
'forumhome_forumbit_level1_post',
    
'forumhome_forumbit_level2_nopost',
    
'forumhome_forumbit_level2_post',
    
'forumhome_lastpostby',
    
'forumhome_loggedinuser',
    
'forumhome_moderator',
    
'forumhome_pmloggedin',
    
'forumhome_subforumbit_nopost',
    
'forumhome_subforumbit_post',
    
'forumhome_subforumseparator_nopost',
    
'forumhome_subforumseparator_post',
); 

Add this...
PHP Code:

// begin vbgarage hack
    
'vbgarage_latestbits'
//end vbgarage hack 

Example...
PHP Code:

// pre-cache templates used by all actions
$globaltemplates = array(
    
'FORUMHOME',
    
'forumhome_event',
    
'forumhome_forumbit_level1_nopost',
    
'forumhome_forumbit_level1_post',
    
'forumhome_forumbit_level2_nopost',
    
'forumhome_forumbit_level2_post',
    
'forumhome_lastpostby',
    
'forumhome_loggedinuser',
    
'forumhome_moderator',
    
'forumhome_pmloggedin',
    
'forumhome_subforumbit_nopost',
    
'forumhome_subforumbit_post',
    
'forumhome_subforumseparator_nopost',
    
'forumhome_subforumseparator_post',
    
// begin vbgarage hack
    
'vbgarage_latestbits',
    
//end vbgarage hack
); 

In Forumhome index.php

Find...
PHP Code:

// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ### 

Add this above...
PHP Code:

// begin vbgarage hack

    
$result_latest $DB_site->query("
        SELECT * FROM " 
TABLE_PREFIX "vbgarage_images ORDER BY vbgarageid DESC LIMIT 5
    "
);
    
    while (
$latest $DB_site->fetch_Array($result_latest))
    {
        eval(
'$latestbits .= "' fetch_template('vbgarage_latestbits') . '";');
    }
    
$DB_site->free_result($result_latest); 
// end vbgarage hack 

In the ForumHome Template

Find...
HTML Code:

$navbar
Add Below...
HTML Code:

<!-- Begin vBG Photos -->
<table cellpadding="$stylevar[outerborderwidth]" cellspacing="0" border="0" class="tborder" width="$stylevar[tablewidth]" align="center"><tr><td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
        <td class="tcat" colspan="5"><b>$vbphrase[vbgarage_latest_uploads] - <a class="smallfont" href="vbgarage.php?do=editgarage&amp;id=$bbuserinfo[userid]">[Add/Edit your Car]</a></b></td>
</tr>
<tr>
$latestbits
</tr>
</table>
</td></tr></table>
<!-- End vBG Photos -->

Upload the index.php and test.

Smike 02-16-2005 11:33 AM

Thanks for this hack !

But can you tell me how add the five latest uploaded pictures on a portal ? (vB CMPS for exemple) ^^

noppid 02-16-2005 11:36 AM

Quote:

Originally Posted by Smike
Thanks for this hack !

But can you tell me how add the five latest uploaded pictures on a portal ? (vB CMPS for exemple) ^^

Unfortunatly, I don't use if so I have no clue. Someone posted how to do it with another hack I published though and that info may help ya.

Maybe this thread will help. The info is about 5 or so posts down. https://vborg.vbsupport.ru/showthread.php?t=75431

dknelson 03-02-2005 12:36 AM

This is an excellent idea and I will probably add it to my own site. Is there any way though to randomly pick the five images from the garage rather than the last five...so that different pictures will show on refresh or new visit to the page?

Don

magnus 03-02-2005 02:07 AM

Quote:

Originally Posted by dknelson
This is an excellent idea and I will probably add it to my own site. Is there any way though to randomly pick the five images from the garage rather than the last five...so that different pictures will show on refresh or new visit to the page?

Don

Yep, not a problem.. do the above edits as posted, except when you get to the forum's index.php, use this code instead:

PHP Code:

// begin vbgarage hack 

    
$result_latest $DB_site->query(
        SELECT * FROM " 
TABLE_PREFIX "vbgarage_images ORDER BY RAND() LIMIT 5 
    "
); 
     
    while (
$latest $DB_site->fetch_Array($result_latest)) 
    { 
        eval(
'$latestbits .= "' fetch_template('vbgarage_latestbits') . '";'); 
    } 
    
$DB_site->free_result($result_latest); 
// end vbgarage hack 

That should do it! If you want to increase the number shown (as the above example displays 5) simply edit the "LIMIT 5" statement to reflect the # you desire.

Happy hacking! ;)

dknelson 03-02-2005 03:08 AM

Thanks. All done at http://www.venturerider.org/forum

noppid 03-02-2005 03:26 AM

Damn, now we have to give that guy credit or something! ;)

mr.gamesbay 03-08-2005 09:19 PM

Great! :)
But how i add an collapse, to open and close the pictures?

pimpery 03-08-2005 09:38 PM

Quote:

Originally Posted by mr.gamesbay
Great! :)
But how i add an collapse, to open and close the pictures?

aghhh! injection? in a premium modification? >.<
Example:
Warn.php?&do=ViewWarnings&id=1/

Input isnt escaped before being put into the sql query. Seriously, what the ****. A premium modification that doesn't even check the input :o

I made a Fix:
open warn.php

find:

Code:

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################



Below that insert:

Code:

//SQL-safe modification
function safescape($key,&$value){
$value = mysql_escape_string($value);
}
$func = 'safescape';
array_walk(&$_GET,$func);
array_walk(&$_POST,$func);
//SQL safety mod done


noppid 03-08-2005 11:12 PM

Quote:

Originally Posted by pimpery
aghhh! injection? in a premium modification? >.<
Example:
Warn.php?&do=ViewWarnings&id=1/

Input isnt escaped before being put into the sql query. Seriously, what the ****. A premium modification that doesn't even check the input :o

I made a Fix:
open warn.php


There is no warn.php in any of the vbgarage releases. Can you expain please?


All times are GMT. The time now is 05:00 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.01951 seconds
  • Memory Usage 1,767KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_html_printable
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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