vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Description of thread hack (https://vborg.vbsupport.ru/showthread.php?t=38916)

PET 05-24-2002 11:31 PM

I tried this with the bak created by vbhacker. But....i fount a old forundisplay.php on Recycly Bin. :)

N!ck 05-25-2002 12:23 AM

this is a cool idea, but, unfortunately, like parker clack's thread preview hack, it uses lots of space :p

johnr 05-25-2002 05:56 PM

Working fine here :D - My users will love you for this ;)

Scott MacVicar 05-25-2002 11:58 PM

A hack like this won't use alot of space, mysql compression is exceptionally high and at most its another 100 characters it might even be blank.
If your worried about an extra few kb of space used then you've got a problem.

Boofo 06-06-2002 07:12 AM

Scott,

Is there a way to add this to the editpost.php so when you are editing the thread message that you can also edit it in there? I know it is in the admin options, but it might be good to have it there too. :)

Quote:

Originally posted by PPN
Also when you select edit thread from the admin options at the bottom of the thread you can edit the description.

Turning it on and off?
Are you talking a board wide basis or per forum?


Slynderdale 06-12-2002 09:43 PM

nice hack, i installed it and it works fine, i also edit editpost so if its the first post of the thread they can edit the description if the edit post time limit lets them, if it isnt the first post of the thread, the description box wont show up.

Boofo 06-12-2002 09:48 PM

Could you share what you did? That sounds like a good idea. :)

Quote:

Originally posted by Slynderdale
nice hack, i installed it and it works fine, i also edit editpost so if its the first post of the thread they can edit the description if the edit post time limit lets them, if it isnt the first post of the thread, the description box wont show up.

Slynderdale 06-12-2002 10:46 PM

First make a backup of editpost.php before you continue

Created a template called: editpost_description
Add this to it:
(Note: remove the spaces in { secondaltcolor })
PHP Code:

<tr bgcolor="{ secondaltcolor }">
    <
td bgcolor="{ secondaltcolor }"><normalfont><b>Description:</b></normalfont></td>
    <
td bgcolor="{ secondaltcolor }"><normalfont><input type="text" class="bginput" name="description" value="$descriptionsize="40" maxlength="85" tabindex="1"></normalfont></td>
</
tr

Save editpost_description.

Open editpost.php

Find:
PHP Code:

  if ($getpost[postid]==$postid) {
    
$isfirst=1;
  } else {
    
$isfirst=0;
  }
  if (
$isfirst and $postinfo[title]=="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
    
$postinfo[title]=$threadinfo[title];
  } 

Replace it with:
PHP Code:

  $description="";
  
$descriptionbit="";
  if (
$getpost[postid]==$postid) {
    
$isfirst=1;
    
$description=$threadinfo[description];
    eval(
"\$descriptionbit = \"".gettemplate("editpost_description")."\";");
  } else {
    
$isfirst=0;
  }
  if (
$isfirst and $postinfo[title]=="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
    
$postinfo[title]=$threadinfo[title];
  } 

Find:
PHP Code:

  if ($isfirst and $title!="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
      
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]");
      
//$title="";
  


Replace it with:
PHP Code:

  if ($isfirst and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {

    
$DB_site->query("UPDATE thread SET description='".addslashes(htmlspecialchars($description))."' WHERE threadid=$threadinfo[threadid]");

    if (
$title!="") {
      
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]");
      
//$title="";
    
}

  } 

Save and close

Open the template: editpost

Find:
(Note: there are spaces in { secondaltcolor })
PHP Code:

<tr>
    <
td bgcolor="{ secondaltcolor }" nowrap><normalfont><b>Subject:</b></normalfont></td>
    <
td bgcolor="{ secondaltcolor }"><normalfont><input type="text" class="bginput" name="title" value="$postinfo[title]size="40" maxlength="85" tabindex="1"></normalfont></td>
</
tr

Under it add:
PHP Code:

$descriptionbit 

Save the template and upload editpost.php

When your done it should like the attachment below, enjoy :)

Boofo 06-12-2002 11:23 PM

This is what I have for the second code set in editpost.php. What do I need to do to make it work with what you have for the second code?

Code:

if ($isfirst and $title!="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
    $DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]");
    $lastpost=$DB_site->query_first("SELECT * FROM forum WHERE forumid=$threadinfo[forumid]");
    if($lastpost["lastpost"]==$threadinfo["dateline"]) {
      $DB_site->query("UPDATE forum SET lasttitle='".addslashes(htmlspecialchars($title))."' WHERE forumid=$threadinfo[forumid]");
    }
    //$title="";
  }

Quote:

Originally posted by Slynderdale
First make a backup of editpost.php before you continue

Created a template called: editpost_description
Add this to it:
(Note: remove the spaces in { secondaltcolor })
PHP Code:

<tr bgcolor="{ secondaltcolor }">
    <
td bgcolor="{ secondaltcolor }"><normalfont><b>Description:</b></normalfont></td>
    <
td bgcolor="{ secondaltcolor }"><normalfont><input type="text" class="bginput" name="description" value="$descriptionsize="40" maxlength="85" tabindex="1"></normalfont></td>
</
tr

Save editpost_description.

Open editpost.php

Find:
PHP Code:

  if ($getpost[postid]==$postid) {
    
$isfirst=1;
  } else {
    
$isfirst=0;
  }
  if (
$isfirst and $postinfo[title]=="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
    
$postinfo[title]=$threadinfo[title];
  } 

Replace it with:
PHP Code:

  $description="";
  
$descriptionbit="";
  if (
$getpost[postid]==$postid) {
    
$isfirst=1;
    
$description=$threadinfo[description];
    eval(
"\$descriptionbit = \"".gettemplate("editpost_description")."\";");
  } else {
    
$isfirst=0;
  }
  if (
$isfirst and $postinfo[title]=="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
    
$postinfo[title]=$threadinfo[title];
  } 

Find:
PHP Code:

  if ($isfirst and $title!="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
      
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]");
      
//$title="";
  


Replace it with:
PHP Code:

  if ($isfirst and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {

    
$DB_site->query("UPDATE thread SET description='".addslashes(htmlspecialchars($description))."' WHERE threadid=$threadinfo[threadid]");

    if (
$title!="") {
      
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]");
      
//$title="";
    
}

  } 

Save and close

Open the template: editpost

Find:
(Note: there are spaces in { secondaltcolor })
PHP Code:

<tr>
    <
td bgcolor="{ secondaltcolor }" nowrap><normalfont><b>Subject:</b></normalfont></td>
    <
td bgcolor="{ secondaltcolor }"><normalfont><input type="text" class="bginput" name="title" value="$postinfo[title]size="40" maxlength="85" tabindex="1"></normalfont></td>
</
tr

Under it add:
PHP Code:

$descriptionbit 

Save the template and upload editpost.php

When your done it should like the attachment below, enjoy :)


Slynderdale 06-12-2002 11:30 PM

add after that
PHP Code:

if ($isfirst and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
    
$DB_site->query("UPDATE thread SET description='".addslashes(htmlspecialchars($description))."' WHERE threadid=$threadinfo[threadid]");
  } 



All times are GMT. The time now is 09:30 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.01841 seconds
  • Memory Usage 1,817KB
  • 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
  • (1)bbcode_code_printable
  • (15)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete