Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > vBgarage
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBGarage Latest Uploads on ForumHome for 4.x.x Details »»
vBGarage Latest Uploads on ForumHome for 4.x.x
Version: , by noppid noppid is offline
Developer Last Online: Sep 2015 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-15-2005 Last Update: Never Installs: 0
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-16-2005, 11:33 AM
Smike Smike is offline
 
Join Date: Jun 2002
Location: Fr
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this hack !

But can you tell me how add the five latest uploaded pictures on a portal ? (vB CMPS for exemple) ^^
Reply With Quote
  #3  
Old 02-16-2005, 11:36 AM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 03-02-2005, 12:36 AM
dknelson dknelson is offline
 
Join Date: Oct 2004
Posts: 412
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 03-02-2005, 02:07 AM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #6  
Old 03-02-2005, 03:08 AM
dknelson dknelson is offline
 
Join Date: Oct 2004
Posts: 412
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. All done at http://www.venturerider.org/forum
Reply With Quote
  #7  
Old 03-02-2005, 03:26 AM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Damn, now we have to give that guy credit or something!
Reply With Quote
  #8  
Old 03-08-2005, 09:19 PM
mr.gamesbay's Avatar
mr.gamesbay mr.gamesbay is offline
 
Join Date: Sep 2004
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great!
But how i add an collapse, to open and close the pictures?
Reply With Quote
  #9  
Old 03-08-2005, 09:38 PM
pimpery pimpery is offline
 
Join Date: Nov 2004
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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
Reply With Quote
  #10  
Old 03-08-2005, 11:12 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

I made a Fix:
open warn.php

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:19 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.05023 seconds
  • Memory Usage 2,324KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_html
  • (6)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete