PDA

View Full Version : Calling a template on a new field


fla5h
12-19-2002, 09:31 PM
I'm new to this, so I'll explain what I have done from the start and what I'm trying to achieve.

I have a movie review forum, what I want is a feedback addition to the postbit. In the form of a template.

So I have done this, I have added a cell in the post table called 'feedback' with the same settings as the messagetext.

I have edited the editpost.php and the editpost template to include an additional message box and update the table with the info.

So now I can place $post[feedback] in the postbit, a member comes along, posts saying he going to watch a film, comes back, edits the thread, and he gets an extra box, fills in a review, posts and it appears in the postbit below the previous message.

What I want to do though is have a statement ( in the showthread.php file ?? ) that basically says, when loading the postbit is there any data stored in the feedback field on the database if so load the template into the postbit.

I would then just place the template name in the postbit and the template would contain formatting and layout and the $post[feedback]

If the template aint 'eval'd then it dont show. I have tried but I cannot get it to work.

Can I have some suggestions on this please ?

Thanks

fla5h
12-20-2002, 10:26 PM
Can anyone help ??

I was hoping this would be fairly simple piece of code ?

Xenon
12-20-2002, 10:35 PM
surely :)

open admin/functions.php
find:
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}

and below add:
if (trim($post[feedback]) == "") {
$post[feedback]="";
} else {
eval("\$post[feedback] = \"".gettemplate("postbit_feedback")."\";");
}
create a template calles postbit_feedback and use $post[feedback] in it and your formating :)

in postbit template just use $post[feedback] :)

fla5h
12-20-2002, 10:59 PM
stunning Xenon

Thank you so much for your time.

Worked a treat.

I am trying to get into the PHP side, my main strength is Javascript

So I hope to help out where I can, but there gonna be hard to make an impact in a place like this !

:)

Xenon
12-20-2002, 11:01 PM
:)
well, /me is a javascript newbie, but i think i can cover it with my php-knowledge :)

www.vbulletintemplates.com
i think there you can show your whole strenght, in templates you can use javascript :)

fla5h
12-21-2002, 04:17 AM
Already done a few.

probably nothing in comparison but I'll have a look

Thanks once again