vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Different 'editpost' template for first post in thread (https://vborg.vbsupport.ru/showthread.php?t=45520)

Sho 11-08-2002 11:55 PM

Different 'editpost' template for first post in thread
 
Hi,

I'm currently developing a role-playing game system for my forums. Every first post in a thread will be part of a story, all other posts are merely comments. So far, I was able to make it happen that the first post in a thread uses a different 'postbit' template. Also, 'newthread' and the whole 'forumdisplay' business are already working.

What I still lack is the ability to use a different 'editpost' template for the first post in a thread. As those first post use different data (new columns in the database, etc.), editing them differs from editing a comment (a comment being a regular post). I have non-rpg forums, too: it would be nice to be able to enable this only for certain forums. Doesn't have to be a funky new page in the Admin Control Panel, source code suffices.

I'm not very good at coding, my brain is empty right now, after working for so many hours. Could anyone please help me? :) 'All I need' is some source code prodiving the described functionality, documented/explained if possible. Please! :classic:

(My English is very cruel, I know. I'm sorry. :()

Logician 11-09-2002 07:02 AM

edit "editpost.php", find:

PHP Code:

eval("dooutput(\"".gettemplate("editpost")."\");"); 

Replace it as:

PHP Code:

if ($isfirst)
{
eval(
"dooutput(\"".gettemplate("editpostfirst")."\");");
}
else
{
eval(
"dooutput(\"".gettemplate("editpost")."\");");


Create a new template "editpostfirst"..

Enjoy.

Sho 11-09-2002 12:03 PM

This looks stunningly easy and elegant. :D

Thanks, Logician, gonna try it out now.


All times are GMT. The time now is 12:28 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.01001 seconds
  • Memory Usage 1,715KB
  • 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
  • (3)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