News:

Wondering if this will always be free?  See why free is better.

Main Menu

Clone Topic

Started by nend, November 05, 2012, 02:06:59 PM

Previous topic - Next topic

skb

I achieved it through phpMyAdmin, but the new posts don't add to the forum stats.

SMF 2.1.4 / TP 2.2.2

Kindred

and never will... that is why you should never do direct database edits unless you know exactly what you are doing...  because you miss all of the additional linked updates
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

skb

Quote from: Kindred on December 14, 2016, 09:05:58 AM
because you miss all of the additional linked updates
This, I did not get  :-[

I am trying to learn, though it may not have been the best of options.

SMF 2.1.4 / TP 2.2.2

nend

This modification in no way copies anything, it just creates a reference in the database to the original topic to load it in a board it wasn't posted in.

It is possible to do this with post, but considering how post and the display is handled, will take quite a few edits and some logic. I am not planning on developing anything like that in the near future.

Goten22

I would like to check on message index if the topic is cloned in order to, for example, style it a little bit. Is it possible?

Visualization in the attachment.

Goten22

This question is more php and sql related, so please take a look even if you've never used this mod.

All right I have something like this:

$request = $smcFunc['db_query']('', '
SELECT id_topic FROM smf_topic_clones',
array(
'id_topic' => $temp1, // I'm not sure what is the purpose of this variable. It's not used anywhere but without this array it doesn't work at all
)
);

while($row = $request->fetch_assoc()) {
       if ($topic['id'] == $row["id_topic"]){
       echo 'topic is cloned';
       break;}
    }


So I'm not sure what is the purpose of "'id_topic' => $temp1" variable? It's not used anywhere but without this array it doesn't work at all.

I also wonder if those whole 'request' and 'while loop' aren't too demanding on the server side? Should I somehow reduce it? How?

Advertisement: