vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Calling a template on a new field (https://vborg.vbsupport.ru/showthread.php?t=46817)

fla5h 12-19-2002 09:31 PM

Calling a template on a new field
 
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:
PHP Code:

        if ($avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        } 

and below add:
PHP Code:

        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


All times are GMT. The time now is 07:32 AM.

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.01067 seconds
  • Memory Usage 1,727KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete