View Full Version : vBGarage Latest Uploads on ForumHome for 4.x.x
noppid
02-15-2005, 10:02 PM
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 ...
// 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...
// begin vbgarage hack
'vbgarage_latestbits',
//end vbgarage hack
Example...
// 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...
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
Add this above...
// 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...
$navbar
Add Below...
<!-- 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&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
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
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:
// 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
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:
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
Below that insert:
//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
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?
dknelson
03-09-2005, 12:22 AM
Not only that...but I don't know of a warn.php in any Vbulletin files either.
Don
noppid
03-09-2005, 11:57 AM
Not only that...but I don't know of a warn.php in any Vbulletin files either.
Don
It appears he posted in the wrong forum from follow ups I see.
mr.gamesbay
03-09-2005, 10:01 PM
Great! :)
But how i add an collapse, to open and close the pictures?
Any clue how to do it? :)
noppid
03-10-2005, 12:43 AM
Any clue how to do it? :)
<!-- Begin vBGarage Collapsable Photos -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan="5">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_vbg')"><img id="collapseimg_forumhome_vbg" src="$stylevar[imgdir_button]/collapse_tcat.gif" alt="" border="0" /></a>
<b>$vbphrase[vbgarage_latest_uploads]</b>
</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_vbg" style="$vbcollapse[collapseobj_forumhome_vbg]">
<tr valign="center">
$latestbits
</tr>
</tbody>
</table>
<!-- End vBGarage Collapsable Photos -->
mr.gamesbay
03-10-2005, 06:56 PM
Thanks! :)
http://www.gamesbay.de/index.php?
But after i installed this mod, when someone is on the "index.php" site, on the "Who is online" the user will be shown in the garage, why?
Any way to fix this?
noppid
03-10-2005, 08:44 PM
Thanks! :)
http://www.gamesbay.de/index.php?
But after i installed this mod, when someone is on the "index.php" site, on the "Who is online" the user will be shown in the garage, why?
Any way to fix this?
hehe, doesn't that drive ya nuts?
I have a fix for it I'm using. However, I aint so sure it's perfect. If I get a minute I may open my functions_online.php and post what I did, however, it's new and I won't support it. I'm only one guy and my time is really limited lately.
mr.gamesbay
03-10-2005, 09:25 PM
hehe, doesn't that drive ya nuts?
I have a fix for it I'm using. However, I aint so sure it's perfect. If I get a minute I may open my functions_online.php and post what I did, however, it's new and I won't support it. I'm only one guy and my time is really limited lately.
Nice ^^
thanks
*waitforthefix*
noppid
03-10-2005, 09:36 PM
I took a quick look. I had to mod vbgarage.php and functions_online.php, and the new template for forumhome.
I did this for vbgarage 4.1.0 beta. I don't have 4.0.x anymore. I may just do the release and let 4.0.x die. As I said, my time is limited and I can't support multiple versions. Folks with 4.0.x will have to rely on each other at that point or upgrade. Even that will be more support then I can handle now though, so who knows what I should do?
mr.gamesbay
03-10-2005, 09:57 PM
I use 4.1.0 i dont use 4.0.x ^^
noppid
03-11-2005, 05:06 AM
I use 4.1.0 i dont use 4.0.x ^^
In forums/includes/functions_online.php find.
case 'bugs':
$userinfo['action'] = construct_phrase($vbphrase['viewing_x'], 'Bugs'); // Don't report 'bugs' as needing to be translated please :p
break;
add below...
case 'vbgarage':
if ($userinfo['values']['do'] != "hthumb")
{
$userinfo['action'] = 'Viewing Photos';
$userinfo['where'] = "<a href=\"vbgarage.php?$session[sessionurl]&do=list\">$vboptions[bbtitle] Photos</a>";
}
else
{
$userinfo['action'] = 'Forum Home Page';
$userinfo['where'] = "<a href=\"index.php?$session[sessionurl]\">$vboptions[bbtitle]</a>";
}
break;
Find...
case 'bugs.php':
$userinfo['activity'] = 'bugs';
break;
add below...
case 'vbgarage.php':
$userinfo['activity'] = 'vbgarage';
break;
In vbgarage.php find...
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
add below...
if( $_REQUEST['do'] == 'hthumb' )
$_REQUEST['do'] = 'thumb';
change vbgarage_latestbits template to this...
<td class="alt2" colspan="1" align="center"><a href="$vboptions[bburl]/vbgarage.php?$session[sessionurl]do=view&id=$latest[userid]&garage=$latest[id]"><img src="$vboptions[bburl]/vbgarage.php?do=<if condition="THIS_SCRIPT == 'index'">h</if>thumb&id=$latest[vbgarageid]" border="0" alt="Photos" /></a></td>
That should fix ya up.
mr.gamesbay
03-11-2005, 11:54 AM
Perfect! Thanks :)
Vaderman
03-11-2005, 11:41 PM
Hmm... I am trying to make the changes listed in the installation package, and everything was going great until I got to:
In NAVBAR:
Find:
<td class="vbmenu_control"><a href="calendar.php?$session[sessionurl]">$vbphrase[calendar]</a></td>
I have looked and looked, and I do not see this in any Navbar template. I am using vb vers 3.0.7, and have a custom skin installed from extremepixals. I am sure I am doing something wrong, I just don't know what it is!
Darius
noppid
03-12-2005, 02:06 AM
You're not using stock code apparently. You'll have to use your judgement on placement.
Vaderman
03-12-2005, 07:12 AM
Ok, got that part fixed, but now I keep getting the error 'Please complete all the fields. Press the back button, correct the problem then try again.' I have filled in each of the fields, but to no avail.
Anyone have any idea's?
rlischer
03-22-2005, 01:25 AM
I did the random garage image on the main page and it works fine.
Thanks
http://www.shadowriders.net
Qwest
03-22-2005, 06:20 PM
Beautiful.
I added this to mine :)
www.envoyforums.com
noppid
03-22-2005, 07:04 PM
Look good. I like that color. ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.