Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Custom Post Prefixes (modified) Details »»
Custom Post Prefixes (modified)
Version: 1.00, by burnz burnz is offline
Developer Last Online: Jun 2005 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-28-2002 Last Update: Never Installs: 25
 
No support by the author.

Custom Post Prefixes

This hack is a modified version of apfeifer Custom Post Prefixes. This modified hack have an ability to assign different forum with a different post prefixes.. also have an ability to change the post prefixes while editing the post..

UPDATES:

Version 1.3
- Update the stupid error that i made.. sory guys..
- Fully working code for forcing user to select the post prefix before posting.

Version 1.2
- Display an error page if user did not select any option from the post prefix list. (suggested by squawell)

Version 1.1
-Enable/disable the Post Prefix function from Forum Permissions under User Group or Forums & Moderators menu (suggested by HellSatan)

Feedback will be appreciated....

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 09-03-2002, 05:25 AM
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
Location: Vancouver (whistler.2010)
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

to update from 1.1 to 1.2 I would..
i dont wanna have to rehack it
Reply With Quote
  #53  
Old 09-03-2002, 12:09 PM
burnz burnz is offline
 
Join Date: Jun 2002
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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...
Reply With Quote
  #54  
Old 09-03-2002, 12:10 PM
burnz burnz is offline
 
Join Date: Jun 2002
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

MalaK_3araby : hope this hack will help you..

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

if you guys have any problem.. just tell me.. i'll try to help you out..
Reply With Quote
  #55  
Old 09-03-2002, 12:13 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you updated the install file yet? And have you added the feature not to force the custom prefix option?
Reply With Quote
  #56  
Old 09-03-2002, 12:15 PM
burnz burnz is offline
 
Join Date: Jun 2002
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo: just finish the hack.. but not yet test... i'll will upload it tomorrow.. sory for the delay..
Reply With Quote
  #57  
Old 09-03-2002, 12:23 PM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

right??
Reply With Quote
  #58  
Old 09-03-2002, 12:32 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.. sory for the delay..
Reply With Quote
  #59  
Old 09-04-2002, 01:16 AM
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
Location: Vancouver (whistler.2010)
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #60  
Old 09-04-2002, 02:00 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #61  
Old 09-04-2002, 04:06 AM
burnz burnz is offline
 
Join Date: Jun 2002
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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....
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:00 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04850 seconds
  • Memory Usage 2,344KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (11)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete