View Full Version : Postbit Templates - added another bit - why does this not work?
rawnet
Fri 11th Jan '02, 8:01am
Cheers for that.
I've added the Postbits/Postbit template to show :
PHP:--------------------------------------------------------------------------------
$onlinestatus $post[profile] $post[pmlink] $post[useremail] $post[homepage] $post[search] $post[buddy] $post[gallery]
--------------------------------------------------------------------------------
(note the last one)
I've then created a custom template called Postbit_Gallery.
However, it's not showing.
How should I call this template from within the Postbits template?
(this is an attempt to show the user's Photopost member gallery)
Cheers,
Ross
Moonwolf
Fri 11th Jan '02, 10:35am
The page itself needs to eval the data into the template Postbit_Gallery then feet the results into $post[gallery]?
You need it to built the data you're going to want to display, then somewhere in the code you'll have a line that says something like this:
eval("\$post['gallery'] .= \"".gettemplate("Postbit_Gallery")."\";");
You need to figure out which .php file is building the page you're looking at, figure out where it's building the page, add in the code to pull the data from the database that refers to the gallery, then put that bit above in somewhere.
Check vbulletin.org, there might be a hack to do what you want, I seem to recall someone doing something simililar and posting it there.
Kathi
rawnet
Fri 11th Jan '02, 10:46am
Hi,
Thanks for responding. I actually want to do something a lot simpler than I appear to have come across.
Basically, I want a button that says "Gallery", which then links to the user's gallery in the Photopost section of my site.
(eg. http://www.servicepals.com/forums/whateverthread.php --> http://www.servicepals.com/gallery)
My code for this button is in the Postbit_Gallery template, simply :
<a href="http://www.servicepals.com/cgi-bin/gallery/index.pl?user=$post[userid]">
<img src="http://www.servicepals.com/cgi-bin/gallery/images/gallery4.gif" border="0" alt="View $userinfo[username]'s Gallery"></a>
Just want a Gallery button going next to all the other buttons.
PLEASE HELP!!! :)
Ross
okrogius
Fri 11th Jan '02, 6:32pm
Originally posted by Moonwolf
The page itself needs to eval the data into the template Postbit_Gallery then feet the results into $post[gallery]?
You need it to built the data you're going to want to display, then somewhere in the code you'll have a line that says something like this:
eval("\$post['gallery'] .= \"".gettemplate("Postbit_Gallery")."\";");
You need to figure out which .php file is building the page you're looking at, figure out where it's building the page, add in the code to pull the data from the database that refers to the gallery, then put that bit above in somewhere.
Check vbulletin.org, there might be a hack to do what you want, I seem to recall someone doing something simililar and posting it there.
Kathi
That line will have to be in admin/functions.php
rawnet
Fri 11th Jan '02, 6:43pm
Hello,
I'm REALLY confused now.
Can someone please explain to a really dumb person what I have to do? I tried adding that line to the bottom of my admin/function.php :
if (!$noshutdownfunc) {
register_shutdown_function("doshutdown");
}
eval("\$post['gallery'] .= \"".gettemplate("Postbit_Gallery")."\";");
?>
but the button still doesn't display. All I want is the code below - so that in the Postbit (below each post) it shows a button called gallery4.gif next to all the other buttons. The only thing dynamic is the userID, which should be the same as the UserID of the person which made the post.
<a href="http://www.servicepals.com/cgi-bin/gallery/index.pl?user=$post[userid]">
<img src="http://www.servicepals.com/cgi-bin/gallery/images/gallery4.gif" border="0" alt="View $userinfo[username]'s Gallery"></a>
Please help!!
Cheers,
Ross
samtha25
Fri 11th Jan '02, 7:17pm
Instead of trying to make a template and change the php file, why don't you just put the link in postbit? Should work fine.
rawnet
Fri 11th Jan '02, 7:35pm
What - a - total - plonker.
Yes - that would do the trick!! Thankyou!! Can't believe I was being so dim. All working fine.
Many thanks guys - sorry for being so blonde,
Cheers,
Ross
okrogius
Fri 11th Jan '02, 7:35pm
Originally posted by rawnet
Hello,
I'm REALLY confused now.
Can someone please explain to a really dumb person what I have to do? I tried adding that line to the bottom of my admin/function.php :
if (!$noshutdownfunc) {
register_shutdown_function("doshutdown");
}
eval("\$post['gallery'] .= \"".gettemplate("Postbit_Gallery")."\";");
?>
but the button still doesn't display. All I want is the code below - so that in the Postbit (below each post) it shows a button called gallery4.gif next to all the other buttons. The only thing dynamic is the userID, which should be the same as the UserID of the person which made the post.
<a href="http://www.servicepals.com/cgi-bin/gallery/index.pl?user=$post[userid]">
<img src="http://www.servicepals.com/cgi-bin/gallery/images/gallery4.gif" border="0" alt="View $userinfo[username]'s Gallery"></a>
Please help!!
Cheers,
Ross
You'll have to add that line in "start build post" section of the functions.php. (around line 60)
Freddie Bingham
Fri 11th Jan '02, 7:42pm
Remember that hacking belongs over at www.vbulletin.org
Moonwolf
Sat 12th Jan '02, 2:53pm
Originally posted by rawnet
sorry for being so blonde,
Hey! I'm the blonde here right now! This year at any rate :p
Kathi
Powered by vBulletin™ Version 4.0.0 Beta 4 Copyright © 2009 vBulletin Solutions, Inc. All rights