Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Yuna Scatari Edition (YSE)
Reply
  #1  
Old 16th July 2009, 12:51
Nilsons Nilsons is offline
Senior Member
 
Join Date: Dec 2007
Latvia
Posts: 40
Default Forums..
So i added to my forums locked reason and unlock reason... when i lock topic it posts new post - And there writes reason and who locked topic....

But i want to ask you how to do this- When i unlock topic the post that was posted with reason why locked automaticly removed ? what code i need to put?

Heres the code -
Code:
///// Add reason to locked code - TBDev - Dokty /////
if ($action == "setlocked")
  {
    $topicid = 0 + $_POST["topicid"];

    if (!$topicid || get_user_class() < UC_MODERATOR)
      die;

    $res2345 = mysql_query("SELECT locked FROM topics WHERE id = " . $topicid) or sqlerr(__FILE__, __LINE__);
        if (mysql_num_rows($res2345) != 1)
            die("Error - No topic with this ID.");
        $arr2345 = mysql_fetch_assoc($res2345);

    $locked = sqlesc($_POST["locked"]);
    mysql_query("UPDATE topics SET locked=$locked WHERE id=$topicid") or sqlerr(__FILE__, __LINE__);
	

        if (($locked != $arr2345["locked"]) && ($_POST["locked"] == "yes")) {
$body = sqlesc("
Topic Locked by ".$CURUSER['username']."\nReason: ".$_POST["lockreason"].".
"); mysql_query("INSERT INTO posts (topicid, userid, added, body) VALUES($topicid, ".$CURUSER['id'].", '" . get_date_time() . "', $body)") or sqlerr(__FILE__, __LINE__); $postid = mysql_insert_id() or die("Post id n/a"); update_topic_last_post($topicid); } if (($locked != $arr2345["locked"]) && ($_POST["locked"] == "no")) { mysql_query("UPDATE posts" $postid = mysql_insert_id() or die("Post id n/a"); update_topic_last_post($topicid); $body = sqlesc("
Topic UnLocked by ".$CURUSER['username']."\nReason: ".$_POST["lockreason"].".
"); mysql_query("INSERT INTO posts (topicid, userid, added, body) VALUES($topicid, ".$CURUSER['id'].", '" . get_date_time() . "', $body)") or sqlerr(__FILE__, __LINE__); $postid = mysql_insert_id() or die("Post id n/a"); update_topic_last_post($topicid); } $returnto = str_replace ('&amp;', '&', htmlentities($_POST["returnto"])); header("Location: ".$returnto); die; }
I tried to do something but im not a coder im trying to learn something .. But i gues that i was doing wrong :D



Sorry my english is terrible :D
Reply With Quote
  #2  
Old 16th July 2009, 15:32
BoLaMN BoLaMN is offline
Senior Member
 
Join Date: Jan 2008
Australia
Posts: 93
Default
so when u unlock the topic u want the

Topic Locked by ".$CURUSER['username']."\nReason: ".$_POST["lockreason"].".

post to be removed automatically?
Reply With Quote
  #3  
Old 16th July 2009, 17:14
Nilsons Nilsons is offline
Senior Member
 
Join Date: Dec 2007
Latvia
Posts: 40
Default
Yap that is what i want :)

Bump: I thought that in this forum is wery helpful peaople... Great coders why don't you help me

Bump: Thanks for no help :sorry:
Reply With Quote
Reply

Tags
forums

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[TT 2.x] Forums adrian21 Mods & Themes 2 26th October 2014 20:03
Forums Not Working pwnage BT.Manager (phpMyBitTorrent) 1 1st February 2010 05:06
forums.php ocha Yuna Scatari Edition (YSE) 2 26th April 2009 21:06
Internal forums ocha Torrent Strike 1 29th March 2009 20:43
TS 4.3 Forums Aeron Template Shares 10 31st May 2008 12:41



All times are GMT +2. The time now is 01:24. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.