vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Must Have First Posters Username In Your reply form (https://vborg.vbsupport.ru/showthread.php?t=45653)

BigJohnson 11-12-2002 09:28 AM

Must Have First Posters Username In Your reply form
 
I was wondering if someone can help me with this. I am looking for a feature for my message board.

People post information about quads and other 4 wheel and 2 wheel vehicles on my forum.

I was wondering if only in these forums this feature can work

13, 17, 19, 20, 26, 27, 33, 34, 44, 45, 51, 52, 58, 59

For ever reply in these forum ids you need to have the FIRST POSTERS username somewhere in your reply box. If not then you are taken to a template that I will make as an error screen. I hope someone can help me out. Thanks.

This is just for the reason that no one notices the people that post information and just read the posts. This helps them understand that this person has posted this info to help you out. Thanks s much.

Xenon 11-12-2002 04:10 PM

open newreply.php find this:
PHP Code:

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

after that add:
PHP Code:

if (in_array($threadinfo['forumid'], array(1317192026273334444551525859))) {
    
$getfirst=$DB_site->query_first("SELECT postid,post.userid,dateline,user.username FROM post LEFT JOIN user USING(userid) WHERE threadid='$threadid' ORDER BY dateline LIMIT 1");
  if(!
strstr($message,$getfirst['username'])) {
  eval(
"standarderror(\"".gettemplate("error_nofirstusername")."\");");
}




then create a template error_nofirstusername and write your message there ;)

BigJohnson 11-12-2002 10:42 PM

thanks works like a charm.

Xenon 11-13-2002 09:38 AM

:)

you're welcome as always ;)

BigJohnson 11-24-2002 05:40 PM

One more thing. How can I make this so it is not capitalization sensative. Like if someone name is UsErNaMe all i can type in the reply box is username instead of the other way. Please help thanks.

Xenon 11-24-2002 06:48 PM

instead of this
PHP Code:

if(!strstr($message,$getfirst['username'])) { 

use this
PHP Code:

if(!strstr(strtoupper($message),strtoupper($getfirst['username']))) { 


BigJohnson 11-26-2002 09:14 AM

Works like a charm amazing. Your god. I love ya. keep up the great work man.

Xenon 11-26-2002 06:28 PM

:)
i'll do my best.

you're welcome

BigJohnson 01-26-2003 03:16 PM

Xenon I just foudn a prob. When u reply more than once in those forums u have to say there username in ever reply u make. How do u make it that they only have to do it on the first reply and then the rest they don't have to at all.

BigJohnson 01-27-2003 07:59 AM

bump

Xenon 01-27-2003 01:26 PM

this ^^
PHP Code:

if($threadinfo[replycount]==and !strstr(strtoupper($message),strtoupper($getfirst['username']))) { 


BigJohnson 01-29-2003 01:22 PM

Quote:

Originally posted by Xenon
this ^^
PHP Code:

if($threadinfo[replycount]==and !strstr(strtoupper($message),strtoupper($getfirst['username']))) { 


This is not working. IT works for like the first replies or two but the other people dont have to have the username in there posts. I don't know why it doesnn't work. Can ya help me. Is there anyother code we could use?

BigJohnson 02-08-2003 10:09 PM

I need it to only have it do it for there first reply. Also how do i make it so if the person that made the new thread doesn't have t put there own name in there replies to there own threads?

Thanks.

Xenon 02-17-2003 05:17 PM

use this:

PHP Code:

$repliesbybbuser=$DB_site->query_first("SELECT COUNT(*) AS total FROM post WHERE userid=$bbuserinfo[userid] AND threadid=$threadid");
if(
$repliesbybbuser['total']==and $getfirst['userid'] != $bbuserinfo['userid'] and !strstr(strtoupper($message),strtoupper($getfirst['username']))) { 


BigJohnson 02-19-2003 01:42 PM

Works great but one little problem

SAY JOHN makes a new thread. And STEVE wants to reply and he doesnt use the users name of JOHN in his reply. He gets the error saying use the username but there is this line at the top of the web page

Warning: Empty Delimiter in /usr/local/psa/home/host/bburl.com/httpdocs/messageboard/newreply.php on line 102

Xenon 02-19-2003 01:51 PM

what is line 102 and about 5 lines above and below :)

BigJohnson 02-19-2003 02:14 PM

sorry haha

PHP Code:

// ############################### start post reply ###############################
if ($HTTP_POST_VARS['action']=="postreply") {

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

if (
in_array($threadinfo['forumid'], array(2324252627282930323334353637385556))) {
$repliesbybbuser=$DB_site->query_first("SELECT COUNT(*) AS total FROM post WHERE userid=$bbuserinfo[userid] AND threadid=$threadid");
if(
$repliesbybbuser['total']==and $getfirst['userid'] != $bbuserinfo['userid'] and !strstr(strtoupper($message),strtoupper($getfirst['username']))) {
  eval(
"standarderror(\"".gettemplate("error_nofirstusername")."\");");
  }
}

  
// decode check boxes
  
$parseurl=iif(trim($parseurl)=="yes",1,0);
  
$email=iif(trim($email)=="yes",1,0);
  
$allowsmilie=iif(trim($disablesmilies)=="yes",0,1);
  
$signature=iif(trim($signature)=="yes",1,0);
  
$preview=iif(trim($preview)!="",1,0); 

102 is

if($repliesbybbuser['total']==0 and $getfirst['userid'] != $bbuserinfo['userid'] and !strstr(strtoupper($message),strtoupper($getfirst['username']))) {

lol

Xenon 02-19-2003 02:20 PM

hmm, this should work normally...

maybe you can try this:
PHP Code:

if(intval($repliesbybbuser['total'])==and $getfirst['userid'] != $bbuserinfo['userid'] and !strstr(strtoupper($message),strtoupper($getfirst['username']))) { 


BigJohnson 02-19-2003 02:24 PM

nope same error. Weird.

BigJohnson 02-19-2003 04:29 PM

with the new code evn though i get that error even though u still put the name in the reply it says u need the usernames name in your reply error. Something is definately wrong. :)

Xenon 02-19-2003 04:40 PM

replace
AND threadid=$threadid

with
AND threadid=$threadinfo[threadid]

...

BigJohnson 02-21-2003 06:14 PM

I get the same error. I don't know why weird. What else can we do?

BigJohnson 02-21-2003 07:00 PM

I foudn the error Xenon.

This line needs to be in there as well.

$getfirst=$DB_site->query_first("SELECT postid,post.userid,dateline,user.username FROM post LEFT JOIN user USING(userid) WHERE threadid='$threadid' ORDER BY dateline LIMIT 1");

because when u look at ur new code at this line

!strstr(strtoupper($message),strtoupper($getfirst['username']))) {

$getfirst has no where to look for. So i put that code above and it worked.

Is this right though or is there an easier better what of doing it?

Xenon 02-21-2003 10:56 PM

yes it has to be there, i thought it would be there already, that's why i didn't mention it again..


All times are GMT. The time now is 02:02 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.01364 seconds
  • Memory Usage 1,796KB
  • 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
  • (9)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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