dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse


Our Discord Notification Server invitation link is https://discord.gg/jB2qmRrxyD

Author Topic: Bump Topic  (Read 19 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7285
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Yesterday at 08:54:11 AM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
Bump Topic
« on: July 30, 2026, 10:58:58 PM »
Compatable With Simple Portal's "Recent Topics"

Usage:

php bump_topic.php nnnnn

Code: [Select]
<?php

// Usage:
// php bump_topic.php <topic_id>

if (php_sapi_name() != &#39;cli&#39;)
    
die("CLI only\n");

require_once(
dirname(__FILE__) . &#39;/SSI.php&#39;);

if ($argc != 2)
    die(
"Usage: php bump_topic.php <topic_id>\n");

$topic_id = (int)$argv[1];

$now time();
$member 1// change to your admin member ID

// Get topic info
$request $smcFunc[&#39;db_query&#39;](&#39;&#39;, &#39;
    
SELECT id_boardid_first_msg
    FROM 
{db_prefix}topics
    WHERE id_topic 
= {int:id_topic}&#39;,
    
array(&#39;id_topic&#39; => $topic_id)
);

if (!
$row $smcFunc[&#39;db_fetch_assoc&#39;]($request))
    
die("Topic not found\n");

$id_board $row[&#39;id_board&#39;];

// Insert a reply
$smcFunc[&#39;db_insert&#39;](&#39;&#39;,
    
&#39;{db_prefix}messages&#39;,
    
array(
        &
#39;id_board&#39; => &#39;int&#39;,
        
&#39;id_topic&#39; => &#39;int&#39;,
        
&#39;id_member&#39; => &#39;int&#39;,
        
&#39;poster_time&#39; => &#39;int&#39;,
        
&#39;poster_name&#39; => &#39;string&#39;,
        
&#39;body&#39; => &#39;string&#39;,
        
&#39;poster_ip&#39; => &#39;string&#39;,
    
),
    array(
        
$id_board,
        
$topic_id,
        
$member,
        
$now,
        &
#39;Admin&#39;,
        
&#39;Topic bumped&#39;,
        
&#39;127.0.0.1&#39;,
    
),
    array(&
#39;id_msg&#39;)
);

$new_msg $smcFunc[&#39;db_insert_id&#39;](&#39;{db_prefix}messages&#39;, &#39;id_msg&#39;);

// Update topic
$smcFunc[&#39;db_query&#39;](&#39;&#39;, &#39;
    
UPDATE {db_prefix}topics
    SET id_last_msg 
= {int:id_msg}
    
WHERE id_topic = {int:id_topic}&#39;,
    
array(
        &
#39;id_msg&#39; => $new_msg,
        
&#39;id_topic&#39; => $topic_id
    
)
);

// Update board
$smcFunc[&#39;db_query&#39;](&#39;&#39;, &#39;
    
UPDATE {db_prefix}boards
    SET id_last_msg 
= {int:id_msg}
    
WHERE id_board = {int:id_board}&#39;,
    
array(
        &
#39;id_msg&#39; => $new_msg,
        
&#39;id_board&#39; => $id_board
    
)
);

echo 
"Topic bumped with new message ID {$new_msg}\n";
« Last Edit: July 30, 2026, 11:07:08 PM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal