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)
-   -   Improved Moderator Alert System (https://vborg.vbsupport.ru/showthread.php?t=48603)

yzztik 04-10-2003 10:28 PM

Quote:

02-07-03 at 09:09 PM Erwin said this in Post #37
To integrate this into your usual reporting methods, you do NOT have to make a new file or make new templates up, or add any extra queries to search the message - everything is in report.php already.

To achieve the same result, while being able to email mods (and if you have the PM mod hack, PM mods as well), just do this (no need to do anything else):

Open report.php.

Find:

PHP Code:

  $url str_replace("\""""$url); 

ABOVE this, ADD:

PHP Code:

$modforum="100"
    
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$modforum','1','0','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".addslashes($bbuserinfo[username])."','".time()."','$iconid','1','0')");
    
$threadid=$DB_site->insert_id();
    
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','Post Alert - $postinfo[username]','$bbuserinfo[username]','$bbuserinfo[userid]','".time()."','".addslashes(parseurl($message))."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
    
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',lastposter='$bbuserinfo[username]' WHERE forumid='$modforum'"); 

Change:

$modforum="100";

To the forumid of your admin forum.

Done! :)

P.S. I hope Overgrow doesn't mind me posting this here - I could post this in a separate hack, but after all, it's his idea, and he should get the credit. :)


When I try this, I get a parse error:

PHP Code:

Parse errorparse errorunexpected ')' in /home/friend/public_html/forum/report.php on line 64 

Any ideas? :-s

Figment 04-11-2003 06:36 AM

Exactly the same error I get if I adopt Erwins suggestion.

I'd like to get this sorted one way or other - either by finding the fix for Erwins method or getting help on making the email to mods work in Overgrows original set up.

TIA

yzztik 04-11-2003 11:02 AM

With Erwins suggestion, the post that gets made, does it include the post they are reporting and their reason too? Also, does it only do the new thread thing, or can it post to an existing thread?

Figment 04-11-2003 11:06 AM

As it uses the existing report.php file, I would presume it works in the same way as the original vB reports, with the addition of a post into the admin/mods forum. I am not sure whether it allows you to choose between new thread per reported post or all reports into one thread, and I have yet to find out whether it includes a copy of the original post, as I cannot test it because of the parse error.

yzztik 04-11-2003 11:10 AM

Yeah same here ... I cannot for the life of me figure out the parse error, I mean it seems there is an extra ) somewhere, but I tried removing some and still got the error, so I am not certain of what it is. It seems to be in the first line of code.

Figment 04-11-2003 12:18 PM

Hmm, just tried replying by email but it hasn't appeared. So apologies if this posts twice

Yes, I've tried that too. Not too hot on PHP, but I tried removing/replacing them one by one, adding an extra '(' here and there all without success. Seem to recall with some combinations the actual error message changed, but I could not get it to work no matter what I tried.

Erwin 04-11-2003 10:10 PM

Try this code:

Find:

PHP Code:

  $url str_replace("\""""$url); 

Above, add:

PHP Code:

$modforum="xx";
    
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$modforum','1','0','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".addslashes($bbuserinfo[username])."','".time()."','$iconid','1','0')");
    
$threadid=$DB_site->insert_id();
    
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','$bbuserinfo[username]','$bbuserinfo[userid]','".time()."','".addslashes(parseurl($message))."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
    
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',lastposter='".addslashes($bbuserinfo[username])."' WHERE forumid='$modforum'"); 

Replace xx with your mod forum.

This is the code I am using.

If you have the LAST TITLE ON FORUM HOME hack, use this code instead (which updates the forum title too).

PHP Code:

$modforum="xx";
    
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$modforum','1','0','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".addslashes($bbuserinfo[username])."','".time()."','$iconid','1','0')");
    
$threadid=$DB_site->insert_id();
    
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','$bbuserinfo[username]','$bbuserinfo[userid]','".time()."','".addslashes(parseurl($message))."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
    
$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',lastposter='".addslashes($bbuserinfo[username])."',lasttitle='".addslashes(htmlspecialchars($subject))."' WHERE forumid='$modforum'"); 

Again, replace xx with your mod forum.

Erwin 04-11-2003 10:10 PM

Sorry to Overgrow for hijacking his thread, but I don't want to release a hack that does the same thing... unless you want me to do so. :)

yzztik 04-12-2003 03:45 PM

I can't find this string:

$url = "\"", "", $url);

All I have is this:

$url = str_replace("\"", "", $url);


When I add it above that, still get a parse error :(

I am using 2.2.9

Figment 04-12-2003 07:16 PM

Ditto here, using 2.2.8


All times are GMT. The time now is 03:08 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.01344 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
  • (6)bbcode_php_printable
  • (1)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