News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Copy Topics

Started by SMFHacks.com Team, January 22, 2008, 11:19:07 PM

Previous topic - Next topic

c a g a t a y

Is there anyone to answer my question?

regards

karlbenson

Sorry I'm not ignoring you.
Just trying to fix something else first.

Check that both images exist at the following locations.
http://{domain and directory to smf}/Themes/default/images/buttons/admin_copy.gif
http://{domain and directory to smf}/Themes/default/images/icons/quick_copy.gif

It would appear they are missing, thats why its showing the alternative/title text instead.

perplexed

#42
hello Karl

I just installed your mod with no errors and for my first attempt I tried to copy two topics at once and  I got this error:

Duplicate entry '225-5337' for key 1
File: /home/perplexed/public_html/forum/Sources/CopyTopic.php
Line: 227


I was trying to copy two topics at once and I just noticed that it has actually copied one of the topics but when I got the error

Duplicate entry '225-5337' for key 1
File: /home/perplexed/public_html/forum/Sources/CopyTopic.php
Line: 227

it said beneath it to click back, like it hadnt done it, but it has copied one of them, so how do I fix the error and get it to copy more than one topic at once?

Also I just noticed that in the one topic it did copy, it didnt copy the attachments in the topic.  There were only two word docs attached at less than 30kb each

Then I tried to copy the second topic again (the one it didnt copy the first time) and I get the same error, different entry key and it didnt copy it at all  ???

Thanks


edited to add:

when I look at the latest posts, it stops and only displays 2 posts though there are 10 pages of posts.  So I ran forum maintenance and got all 10 pages of posts back, and the missing copied topic also appeared.  Looks like it was preventing the 10 pages of recent posts to be displayed.

Something isnt right :(

karlbenson

@perplexed

I had similar errors on one of my test boards. But it was due to pre-existing errors in my database.

Via Maintenance
Click Find and repair any errors.
Then Recount all forum totals and statistics.
Then Click Find and repair any errors again.

Overall the mod has been heavily tested (to the point of copying 500,000 posts in one go with attachments on each).

perplexed

yeah I did all this

Via Maintenance
Click Find and repair any errors.
Then Recount all forum totals and statistics.
Then Click Find and repair any errors again.

after the first error message, and it seemed to allow the copied topic to display, but not the second one.  Then I tried to copy the second topic again, and it only appeared after I ran the forum maintenance again.  So I am I going to have to run forum maintenance every time I copy a topic? 

It did say something about the database needing upgrading or something in the error message, but the database is up to date


It is also not copying the attachments


karlbenson

No, you shouldn't have to do it more than once.

What mods do you have installed?
- Especially any that alter attachments.


karlbenson

Please can you copy and paste the list of mods installed.

Are you getting any other errors in your error logs.

perplexed

sorry,here is the list, it's rather long:

    Mod Name     Version

   Auto Embed Video Clips    2.1.4    [ Uninstall ] [ List Files ] [ Delete ]
    Create Topic on Report to Moderator    0.2    [ Uninstall ] [ List Files ] [ Delete ]
    Welcome Topic Mod    1.1    [ Uninstall ] [ List Files ] [ Delete ]
    Member Awards    1.0.2    [ Uninstall ] [ List Files ] [ Delete ]
    SMF Arcade    2.0.12    [ Uninstall ] [ List Files ] [ Delete ]
    SmileyLimit    1.0    [ Uninstall ] [ List Files ] [ Delete ]
    Signature Settings Mod    1.1    [ Uninstall ] [ List Files ] [ Delete ]
    Karma Description Mod    2.3    [ Uninstall ] [ List Files ] [ Delete ]
    FlashChat Integration    1.0    [ Uninstall ] [ List Files ] [ Delete ]
    Personal Message Auto Responder    0.2    [ Uninstall ] [ List Files ] [ Delete ]
    View_Email_Permission    1.0    [ Uninstall ] [ List Files ] [ Delete ]
    Signature Area BBCode Buttons    1.5    [ Uninstall ] [ List Files ] [ Delete ]
    Anti-Bot Registration Puzzles    1.1    [ Uninstall ] [ List Files ] [ Delete ]
    Referrals Mod    1.4    [ Apply Mod ] [ List Files ] [ Delete ]
    Ultimate Shoutbox    1.40    [ Uninstall ] [ List Files ] [ Delete ]
    Monthly Statistics on Profile    1.0    [ Uninstall ] [ List Files ] [ Delete ]
    Ad Managment    2.3    [ Uninstall ] [ List Files ] [ Delete ]
    Karma On Memberlist    1.0    [ Uninstall ] [ List Files ] [ Delete ]
    Global Announcements    1.0    [ Uninstall ] [ List Files ] [ Delete ]
    MCLegendII    1.1    [ Uninstall ] [ List Files ] [ Delete ]
    Custom Profile Field Mod    3.17    [ Uninstall ] [ List Files ] [ Delete ]
    Buy Me A Beer    1.4    [ Uninstall ] [ List Files ] [ Delete ]
    Reason For Editing Mod    1.14    [ Uninstall ] [ List Files ] [ Delete ]
    Color And BgColor BBCode Bar    3.3    [ Uninstall ] [ List Files ] [ Delete ]
    Zodiac_Starsigns    1.2    [ Uninstall ] [ List Files ] [ Delete ]
    Profile Comments    1.3.6    [ Uninstall ] [ List Files ] [ Delete ]
    Spoiler Tag    0.3.2    [ Uninstall ] [ List Files ] [ Delete ]
    Custom BBCode    2.00    [ Uninstall ] [ List Files ] [ Delete ]
    EmailFlash    2.0    [ Uninstall ] [ List Files ] [ Delete ]
    Sticky First Post (extends sticky topic)    1.3.2    [ Uninstall ] [ List Files ] [ Delete ]
    Users Online Today Mod    1.4.0    [ Uninstall ] [ List Files ] [ Delete ]
    SMF 1.1.4 Search "brd" Bug Fix (1.0.1)    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
    Save PM as HTML    1.0.6    [ Uninstall ] [ List Files ] [ Delete ]
    Googlebot & Spiders Mod    2.0.3    [ Uninstall ] [ List Files ] [ Delete ]
    LogModAccountEdits    1.9    [ Uninstall ] [ List Files ] [ Delete ]
    Country Flags    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
    Show Multiple Badges (Aka Stars)    1.0    [ Uninstall ] [ List Files ] [ Delete ]
    Copy Topics    1.1    [ Uninstall ] [ List Files ] [ Delete ]
    VisualWarning    1.41    [ Uninstall ] [ List Files ] [ Delete ]
    SMFShop    3.0    [ Uninstall ] [ List Files ] [ Delete ]
    Reg Bar    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
    User Control Panel By Alan S    2.0    [ Uninstall ] [ List Files ] [ Delete ]
    Ultimate Profile    0.8    [ Uninstall ] [ List Files ] [ Delete ]
    Enhanced Quick Reply Box 2.0.2    2.0.2    [ Uninstall ] [ List Files ] [ Delete ]
    Temporary fix    0.5    [ List Files ] [ Delete ]
    Topic Ratings    1.03    [ Uninstall ] [ List Files ] [ Delete ]
    TinyPortal    0.983    [ Uninstall ] [ List Files ] [ Delete ]
    Topic Member Post Count    1.1.5          [ Uninstall ] [ List Files ] [ Delete ]
    Group on Registration    1.1.1          [ Uninstall ] [ List Files ] [ Delete ]
    Are You Human? Anti-Bot Registration Check    [ Uninstall ] [ List Files ] [ Delete ]


no other errors in the log, just this one twice, one for each time I tried to copy a topic:

Database Error: Duplicate entry '225-5337' for key 1
File: /home/perplexed/public_html/forum/Sources/CopyTopic.php
Line: 227

Database Error: Duplicate entry '28-5347' for key 1
File: /home/perplexed/public_html/forum/Sources/CopyTopic.php
Line: 227

karlbenson

ok, this is a bug I think.

Open Sources/CopyTopics.php

Lines 214-230
FIND & REMOVE
// --- Log_Search_Results ---
// Include this new topic in existing search results
// The Columns for the table with our new msg id and topic id instead
$insert = "ID_SEARCH, ID_TOPIC, ID_MSG, relevance, num_matches";
$select = "r.ID_SEARCH, '$topic_id', m.ID_MSG, r.relevance, r.num_matches";

// Query to Copy EVERY matching row
db_query("
INSERT INTO {$db_prefix}log_search_results (". $insert .")
SELECT ". $select ."
FROM {$db_prefix}log_search_results as r
LEFT JOIN {$db_prefix}messages as m ON (r.ID_MSG = m.ID_MSG_MODIFIED)
WHERE m.ID_TOPIC = ".$topic_id."
", __FILE__, __LINE__);

// Tidy up
unset($insert,$select);


Then do the maintenance Links again.

Then try to copy topics again.

perplexed

:D, ok did all that and tested it again and this time no error AND it also kept the attachment, no errors in the log either

thanks Karl!

Very cool

karlbenson

I will release v1.2 in a moment which removes this part.
I don't know why its causing an error, but it isn't needed anyway.

All it does is add this topic into existing cached searches for matching keywords.

perplexed

hmmm how odd.  do I need to upgrade then or just keep the one I have now it's been amended?

karlbenson

Nah, you'll be fine. No need to upgrade.
I'm just going to comment the code out for now anyway.

Just packaging it up actually.  Will be posted in a few...


karlbenson

1.2 - 15th March 2008
o Removed/disabled copying of 'cached search entries' as causing duplicate key issues

karlbenson

Only a minor tweak was required to get the 2.0 Beta 2 version to work on Beta 3.

1.3 - 21st March 2008
o Fixed to make install for SMF 2.0 Beta 3 Public

Enjoy!

Apllicmz

Yes thank you
Nice Mod Work Fine
Trans. Portuguese.php suporte 114,2.0 Beta

<file name="$languagedir/Modifications.portuguese.php" >
<!--// Adds the language strings used by this modification //-->
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
$txt['copytopic_copyto'] = 'Copiar para';
$txt['quick_mod_copy'] = 'Copiar selecionados para';
$txt['copytopic'] = 'Copia Topico';
$txt['copytopics'] = 'Copia Topicos';
$txt['cannot_copy'] = 'Você não tem as permissões para permitir que você copiar um tópico';
$txt['copytopic_noboards'] = 'Não há quadro para copiar a este tópico!';
$txt['copytopic_notallowed'] = 'Você não tem permissão para copiar tópicos do quadro não é possível visualizar!';
$txt['permissionname_copy'] = 'Copia Topico';
$txt['permissionhelp_copy'] = 'Copiar um tópico de um quadro para a outra. Os usuários podem selecionar apenas alvo quadro que estão autorizados a aceder.';
$txt['copytopic_negativeseo'] = 'Estar ciente de que existe talvez um efeito negativo SEO, copiando tópicos como ela pode obter detectado pelo Search Engines como duplicada conteúdo.';
]]></add>
</operation>
</file>

<file name="$languagedir/Modifications.portuguese-utf8.php" error="skip">
<!--// Adds the language strings used by this modification //-->
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
$txt['copytopic_copyto'] = 'Copiar para';
$txt['quick_mod_copy'] = 'Copiar selecionados para';
$txt['copytopic'] = 'Copia Topico';
$txt['copytopics'] = 'Copia Topicos';
$txt['cannot_copy'] = 'Você não tem as permissões para permitir que você copiar um tópico';
$txt['copytopic_noboards'] = 'Não há quadro para copiar a este tópico!';
$txt['copytopic_notallowed'] = 'Você não tem permissão para copiar tópicos do quadro não é possível visualizar!';
$txt['permissionname_copy'] = 'Copia Topico';
$txt['permissionhelp_copy'] = 'Copiar um tópico de um quadro para a outra. Os usuários podem selecionar apenas alvo quadro que estão autorizados a aceder.';
$txt['copytopic_negativeseo'] = 'Estar ciente de que existe talvez um efeito negativo SEO, copiando tópicos como ela pode obter detectado pelo Search Engines como duplicada conteúdo.';
]]></add>
</operation>
</file>

</modification>



SAMm

hi man
nice mod

but, can you say me only how can i put te X to delete de topic like you have in the first screenshot?

this X only see the admins ¿?
thx!!

karlbenson

You need to enable Quick Moderation.

profile > Look And Layout >

Enable Quick Moderation.  Select Icons or Checkboxes.

SAMm

thanks karl!
i dont see that line :P what a n00b question xD

Advertisement: