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)
-   -   Custom Post Prefixes (modified) (https://vborg.vbsupport.ru/showthread.php?t=42890)

snyx 09-03-2002 05:25 AM

to update from 1.1 to 1.2 I would..
i dont wanna have to rehack it :(

burnz 09-03-2002 12:09 PM

the change from version 1.1 to 1.2 is on the newthred.php and editpost.php file :D

newthread.php

Find:
PHP Code:

$templatesused "newpost_postpreview,error_nosubject,redirect_postthanks,email_moderator,emailsubject_moderator,newthread_postpoll,newpost_attachment,newpost_disablesmiliesoption,forumrules,newthread,posticons,posticonbit"

Replace with:
PHP Code:

$templatesused "newpost_postpreview,error_nosubject,error_posttype,redirect_postthanks,email_moderator,emailsubject_moderator,newthread_postpoll,newpost_posttype,newpost_posttypebit,newpost_attachment,newpost_disablesmiliesoption,forumrules,newthread,posticons,posticonbit"


Find:
PHP Code:

    // check for subject and message
    
if (trim($subject)=="" or trim($message)=="") {
      eval(
"standarderror(\"".gettemplate("error_nosubject")."\");");
      exit;
    } 

Add below:
PHP Code:

    if (trim($posttype2)=="") {
      
$custompostname $foruminfo[custompostname];
      eval(
"standarderror(\"".gettemplate("error_posttype")."\");");
      exit;
    } 



editpost.php

Find:
PHP Code:

$templatesused="forumrules,newpost_disablesmiliesoption,editpost,posticons,posticonbit,username_loggedin,redirect_editthanks"

Replace with:
PHP Code:

$templatesused="forumrules,newpost_disablesmiliesoption,editpost,error_posttype,newpost_posttype,newpost_posttypebit,posticons,posticonbit,username_loggedin,redirect_editthanks"

Find:
PHP Code:

    // check for message
  
if ($message=="") {
    eval(
"standarderror(\"".gettemplate("error_nosubject")."\");");
    exit;
  } 

Add Below:
PHP Code:

  if (trim($posttype2)=="") {
    
$custompostname $foruminfo[custompostname];
    eval(
"standarderror(\"".gettemplate("error_posttype")."\");");
    exit;
  } 

---------------------------------//----------------------------------------
Below is the update for version 1.1 but i forgot to include it with version 1.1. please check the code..

sory for the mess..

Find: (version 1.1)
PHP Code:

  if (!empty($foruminfo[custompostname])) {
    
$prefixes explode(" "$foruminfo[customposttypes]);

    
$posttypeoptions "";

    
$total count($prefixes);
    
$count "0";

    while (
$count $total) {
      
$prefixes[$count] = str_replace("_"" "$prefixes[$count]);
      
$selected=iif($prefixes[$count]==$threadinfo[customprefix],"selected","");
      eval(
"\$posttypebit = \"".gettemplate("newpost_posttypebit")."\";");
      
$posttypeoptions .= $posttypebit;
      
$count++;
    }

    
$permissions=getpermissions();

    if (
$permissions['canusecustomprefixes']) {
      
$custompostname $foruminfo[custompostname];
      eval(
"\$posttype = \"".gettemplate("newpost_posttype")."\";");
    }
  } 

Replace below
PHP Code:

  if (!empty($foruminfo[custompostname])) {
    
$prefixes explode(" "$foruminfo[customposttypes]);

    
$posttypeoptions "";

    
$total count($prefixes);
    
$count "0";

    while (
$count $total) {
      
$prefixes[$count] = str_replace("_"" "$prefixes[$count]);
      
$selected=iif($prefixes[$count]==$threadinfo[customprefix],"selected","");
      eval(
"\$posttypebit = \"".gettemplate("newpost_posttypebit")."\";");
      
$posttypeoptions .= $posttypebit;
      
$count++;
    }

    
$permissions=getpermissions($foruminfo[forumid]);

    if (
$permissions['canusecustomprefixes'] or $permissions['canusepostprefixes']) {
      
$custompostname $foruminfo[custompostname];
      eval(
"\$posttype = \"".gettemplate("newpost_posttype")."\";");
    }
  } 

Run the query:
PHP Code:

ALTER TABLE forumpermission ADD canusepostprefixes SMALLINT(6NOT NULL AFTER canpostnew

i forgot to include the template sory..

Create new template name error_posttype
Code:

               
Please select the <b>$custompostname</b> field. Press the back button, correct the problem and try again.

hope this will help ya out..

//regards...

burnz 09-03-2002 12:10 PM

MalaK_3araby : hope this hack will help you.. :D

Minifreunde: glad to hear that... hope you like my small hack... :D

if you guys have any problem.. just tell me.. i'll try to help you out.. :D

Boofo 09-03-2002 12:13 PM

Have you updated the install file yet? And have you added the feature not to force the custom prefix option? :)

burnz 09-03-2002 12:15 PM

Boofo: just finish the hack.. but not yet test... i'll will upload it tomorrow.. :D sory for the delay.. :D

squawell 09-03-2002 12:23 PM

i think it should be creat a new template--error_posttype

right??

Boofo 09-03-2002 12:32 PM

Ok, great! I'll wait for the update from you before I update it then. :)

Quote:

Originally posted by burnz
Boofo: just finish the hack.. but not yet test... i'll will upload it tomorrow.. :D sory for the delay.. :D

snyx 09-04-2002 01:16 AM

I have an error where everything works, but when my users try to submit new threads in forums where its not being used, they get the error message? anyone have any clues, im stummped.. I even rehacked it all and still got the same problem.

Boofo 09-04-2002 02:00 AM

Are you using the updated version or the first version in the first post? I am using the version from the first post and I just tried posting in a forum that doesn't have the prefix enabled in it and it did the new thread just fine.

Quote:

Originally posted by snyx
I have an error where everything works, but when my users try to submit new threads in forums where its not being used, they get the error message? anyone have any clues, im stummped.. I even rehacked it all and still got the same problem.

burnz 09-04-2002 04:06 AM

sory guys... it have an error in the version 1.2 code... a stupid error... :(

please use the code in version 1.1... do not use the version 1.2 because there is an error on the coding.. will debug the code as soon as possible... sory for the inconvenience... :(

//regards....


All times are GMT. The time now is 09:39 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.01308 seconds
  • Memory Usage 1,782KB
  • 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
  • (11)bbcode_php_printable
  • (2)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