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)

burnz 09-02-2002 07:17 AM

update the hack one more time. :D

this time i'll add the feature requested by squawell... :D

hope this will work for ya...

Boofo 09-02-2002 07:26 AM

I just installed this (with no problems, I might add. Great directions! :)) and I see there is an update already. Can you tell us what exactly you changed so we don't have to go through it all again? And can we have an option NOT to force the user to pick a Custom Prefix if we don't want to force that option?

Boofo 09-02-2002 07:28 AM

I forgot to add, can we set this on a parent forum and have it just treat the forums under the parent the same? If I missed something, sorry. :)

burnz 09-02-2002 07:47 AM

Boofo:
1. could you what format should i do for the updates? should i create another file just for updates or just list the updates at the bottom of the file... or should i just paste it here in the forum...

2. I'll do it later this evening or tomorrow... :D

3. No.. :D Each forum have their own prefixes setting.. :D

Boofo 09-02-2002 07:59 AM

Putting it in the text file under a special section at the top would be good (or bottom). And posting it in here might not be a bad idea either.

Is there a way to add something to this so we can set it in the parent to work on all forums underneath it if we want to? An option, maybe?

Any way to have it not force the user to pick, too? :)

Quote:

Originally posted by burnz
Boofo:
1. could you what format should i do for the updates? should i create another file just for updates or just list the updates at the bottom of the file... or should i just paste it here in the forum...

2. I'll do it later this evening or tomorrow... :D

3. No.. :D Each forum have their own prefixes setting.. :D


burnz 09-02-2002 09:22 AM

okey.. i'll make the changes for the future updates.. thanks for the input.. :D

wait for the new updates... :D

Boofo 09-02-2002 09:31 AM

Great! I'll be looking forward to it. Thank you for all of your hard work. :)

squawell 09-02-2002 10:09 AM

Quote:

Originally posted by burnz
update the hack one more time. :D

this time i'll add the feature requested by squawell... :D

hope this will work for ya...

thankz man...

but which part should i edit??i cannt see whats different with

the code?? :(

MalaK_3araby 09-02-2002 02:11 PM

This is one great hack ..

Thanks burnz ..
i got my copy and will try installing later on tonight .. then i will be back for clicking the INSTALL btn.

Good Work Indeed.

Kars10 09-02-2002 02:23 PM

Thanx Burnz!
Installation was very easy and works like a charm on 2.2.7 (with many many modifications) ;)
[high]* Minifreunde klicks install!![/high]

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....

snyx 09-04-2002 05:10 AM

thx man, I love the way users have to use the feature, any chance in 1.3 to have an option "enforce prefix use" in the edit froum details.. thx anyways I will be posted for the new code :D

burnz 09-04-2002 05:58 AM

okey guys... i'm sory for the version 1.2 :(
i'll mess up the code... and it's a really stupid mistake that i made... :(

i already update the hack and include the upgrade file... hope it works...

regards....

snyx 09-04-2002 01:44 PM

thx man I will try it out later today.. :)

lynda 09-04-2002 02:00 PM

This looks like it's a GREAT hack! I got it installed with no errors, I double checked that it added all the right fields to the tables, etc and I did my best to doublecheck the php added and everything SEEMS fine..

Except that the customprefix is NOT being saved in the thread table at all.

Can anyone help me narrow down where this error might be occuring?

Thanks in advance. :)

lynda 09-04-2002 02:19 PM

Okay, nevermind my above post.

I used vbPortal and it turns out in editpost.php I accidentally pasted some text right into a commented out line. :) All is well now and it works *GREAT* !!

burnz 09-05-2002 09:35 AM

:D glad you use the hack... hope you like it.. :D

Boofo 09-05-2002 09:47 AM

burnz, any chance of getting an option to turn the "force user to pick custom prefix" on and off in the Admin CP? :)

burnz 09-05-2002 10:56 AM

Boofo: version 1.3 already have that option... it's under forum permission... or under edit forum...

//regards

Boofo 09-05-2002 10:58 AM

Ok, thanks. I haven't updated yet. I was waiting for everything to get done. Sorry about that. :)

burnz 09-05-2002 11:08 AM

that's okey... not a problem.. :D

Joe Page 09-05-2002 08:20 PM

This sounds like a great add-on, I'll have to try it :)

burnz 09-06-2002 02:46 AM

it is a great add-on.. :D

Dark_Wizard 09-06-2002 01:47 PM

Sweet hack! Excellent job!

/me clicks install...

burnz 09-09-2002 02:10 AM

thank you very much... :D
hope you like it..

SWFans.net 10-12-2002 10:51 PM

I like this hack but think it could use one more additional feature. A check to see if the change of the prefix when editing a post is being done in the first post, else it will not update it.

As it is now, and one in a thread can edit their post and change the prefix to whatever they wish.

SWFans.net 10-12-2002 11:09 PM

Nevermind, I was able to find some code within Editpost.php to use to make it so that the drop down for the prefix only shows when editing the first post myself. :)

Nice hack.

Thanks. :)

squawell 10-14-2002 10:35 AM

Quote:

Originally posted by SWFans.net
Nevermind, I was able to find some code within Editpost.php to use to make it so that the drop down for the prefix only shows when editing the first post myself. :)

Nice hack.

Thanks. :)

hello....im also have that problrm can u tell me how to edit that?

thankz...

SWFans.net 10-14-2002 09:09 PM

This probably isn?t the most efficient way to do it, but here is how I did my editpost.php file modification so that only when editing the first post would you be able to change the topic prefix. Changes are in the attached file. Use them in place of the modifications for editpost.php for this hack if you like my method of implementation.

All credit for this really does go to the original hack?s author. I just modified it for my needs and do thank him for the well-written and powerful hack. :)

burnz 10-15-2002 01:12 AM

Thanks for the update of the code.. i will apply it to the original code soon... right now I'm kinda busy with the other project...

squawell 10-15-2002 03:55 AM

Quote:

Originally posted by SWFans.net
This probably isn?t the most efficient way to do it, but here is how I did my editpost.php file modification so that only when editing the first post would you be able to change the topic prefix. Changes are in the attached file. Use them in place of the modifications for editpost.php for this hack if you like my method of implementation.

All credit for this really does go to the original hack?s author. I just modified it for my needs and do thank him for the well-written and powerful hack. :)

thankz man..... :D :D

it works well........ :D


All times are GMT. The time now is 05:52 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.01534 seconds
  • Memory Usage 1,854KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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