Advertisement:

Author Topic: Ignore Topics  (Read 48343 times)

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,350
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Ignore Topics
« Reply #20 on: April 04, 2010, 04:07:08 PM »
* Kat gives vbgamer admin access... ;)
I wish I would fix a couple things on this site mainly for performance.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #21 on: April 04, 2010, 04:12:34 PM »
Yay, I can stop work on the almost finished first paid mod I was going to do.

Though mine's actually smaller and faster than this, all I needed to add to it was quick moderation access and an interface to view them; I already fixed the whole process of ignoring topics without any kind of speed penalty whatsoever... and with far fewer edits too...
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline 摩托车

  • Jr. Member
  • **
  • Posts: 376
Re: Ignore Topics
« Reply #22 on: April 05, 2010, 04:10:22 PM »
Bummer that there's a known way out there to do this faster/better...

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #23 on: April 05, 2010, 04:16:15 PM »
Wouldn't say 'better', though I can't deny it is faster because it makes no DB changes, and does nothing to the query that SMF runs out of the box. All it does is fudge the 'last message I read in that topic' to be the highest possible ID that SMF can have safely.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #24 on: April 10, 2010, 05:11:04 AM »
If anyone's interested, here's the hack I did for my forum. It's not complete, though, since there's no way to view what topics are ignored, and there are fringe cases that aren't very pretty (marking unread unignores it, but I kinda figured that was the case)

Just as food for thought, anyway.


EDIT: I figured out why this worked for me; I forgot to add english.xml. Since I'm not at home I just remade the file.
« Last Edit: April 19, 2010, 07:36:45 PM by Arantor »
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline ~DS~

  • SMF Hero
  • ******
  • Posts: 2,599
  • Gender: Male
Re: Ignore Topics
« Reply #25 on: April 10, 2010, 02:27:31 PM »
If anyone's interested, here's the hack I did for my forum. It's not complete, though, since there's no way to view what topics are ignored, and there are fringe cases that aren't very pretty (marking unread unignores it, but I kinda figured that was the case)

Just as food for thought, anyway.
:P
“There is no god, and that’s the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #26 on: April 10, 2010, 02:27:51 PM »
Huh. Worked for me just fine.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,101
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Ignore Topics
« Reply #27 on: April 19, 2010, 04:01:39 PM »
...
You will also need to copy the images into each Theme
Themes/{themename}/images/icons/ignore_topic.gif
...
Can't find this graphic even though the mod installed OK. Can't find it in the install instructions either. Is it a typo?
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,101
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Ignore Topics
« Reply #28 on: April 19, 2010, 04:43:38 PM »
I have installed this now on two 2.0 RC3 forums and it works OK on both except that on one, when I click show new replies to your posts I get the following error:

Code: [Select]
Unknown column 'pi.id_topic' in 'on clause'
File: /home/nas05l/f/fiftyplusforum.co.uk/user/htdocs/forum/Sources/Recent.php
Line: 1093

I have compared the Recent.php file between the two forums (which are basically identical, one live, one test) and the two files are the same.

If I disable Ignore Topics in the Admin > Boards > Settings then the show new replies works OK. Tried several times and each time IT is enabled the error appears.

Any ideas ?

[EDIT]
Here's the error log entry too.

Code: [Select]
http://www.fiftyplusforum.co.uk/forum/index.php?action=unreadreplies
Database Error: Unknown column 'pi.id_topic' in 'on clause'
File: /home/nas05l/f/fiftyplusforum.co.uk/user/htdocs/forum/Sources/Recent.php
Line: 1093
« Last Edit: April 19, 2010, 05:46:15 PM by Chas Large »
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,101
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Ignore Topics
« Reply #29 on: April 26, 2010, 07:29:22 AM »
*Bump*

Anyone any ideas about this error please  ???
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,101
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Ignore Topics
« Reply #30 on: May 18, 2010, 04:32:05 AM »
** Second Bump Up **

Come on vbGamer, give us a clue, please?  :(
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #31 on: May 18, 2010, 04:39:45 AM »
Care to attach the file it's complaining about?
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,101
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Ignore Topics
« Reply #32 on: May 18, 2010, 04:54:36 AM »
Care to attach the file it's complaining about?
Here is the recent.php file. I couldn't see any problem with it compared to the forum that is working but thanks for taking a look.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #33 on: May 18, 2010, 05:06:19 AM »
Any other mods on the site it doesn't work properly on?

Also, for the purposes of debugging, please turn on Admin > Security > Include database query in the error log and reproduce the error so I can see the whole query in question.

Thing is, I can't see any relevance whatsoever on line 1093, almost as if it's the wrong file :(
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,101
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Ignore Topics
« Reply #34 on: May 18, 2010, 05:09:45 AM »
My Apologies, I must have uninstalled it but it failed in some way. When I compared the file (just downloaded from the site) against my test site, I can see there is no relevance. So I checked and it appeared to be installed. So I uninstalled and then reinstalled and enabled it. It's working but gives the error as above still.

Attached now is the very latest version of Recent.php. I have quickly compared this to the manual install instructions and all the mod seems to have been installed correctly.

All other mods in the site are working fine.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #35 on: May 18, 2010, 05:14:15 AM »
Bingo, now I can see the problem. The query that finishes on line 1093 is broken.

Here's the product query:
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT t.id_topic
FROM {db_prefix}topics_posted_in AS t
LEFT JOIN {db_prefix}log_topics_posted_in AS lt ON (lt.id_topic = t.id_topic)
'. ($can_ignore ? 'LEFT JOIN {db_prefix}ignore_topics AS it ON (it.id_topic = pi.id_topic AND it.id_member = {int:current_member})' : '') .'
WHERE t.' . $query_this_board . '
AND IFNULL(lt.id_msg, t.id_msg) < t.id_last_msg
'. ($can_ignore ? 'AND IFNULL(it.id_topic, 0) = 0' : '') .'
ORDER BY {raw:order}
LIMIT {int:offset}, {int:limit}',
array_merge($query_parameters, array(
'current_member' => $user_info['id'],
'order' => (in_array($_REQUEST['sort'], array('t.id_last_msg', 't.id_topic')) ? $_REQUEST['sort'] : 't.sort_key') . ($ascending ? '' : ' DESC'),
'offset' => $_REQUEST['start'],
'limit' => $context['topics_per_page'],
))
);

And it's saying that it doesn't know pi.id_topic - well, here it doesn't because we never defined pi as a table alias. Should be:

Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT t.id_topic
FROM {db_prefix}topics_posted_in AS t
LEFT JOIN {db_prefix}log_topics_posted_in AS lt ON (lt.id_topic = t.id_topic)
'. ($can_ignore ? 'LEFT JOIN {db_prefix}ignore_topics AS it ON (it.id_topic = t.id_topic AND it.id_member = {int:current_member})' : '') .'
WHERE t.' . $query_this_board . '
AND IFNULL(lt.id_msg, t.id_msg) < t.id_last_msg
'. ($can_ignore ? 'AND IFNULL(it.id_topic, 0) = 0' : '') .'
ORDER BY {raw:order}
LIMIT {int:offset}, {int:limit}',
array_merge($query_parameters, array(
'current_member' => $user_info['id'],
'order' => (in_array($_REQUEST['sort'], array('t.id_last_msg', 't.id_topic')) ? $_REQUEST['sort'] : 't.sort_key') . ($ascending ? '' : ' DESC'),
'offset' => $_REQUEST['start'],
'limit' => $context['topics_per_page'],
))
);
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,101
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Ignore Topics
« Reply #36 on: May 18, 2010, 05:24:43 AM »
Thanks Arantor, Now for the oddity.

I uploaded the file that I gave you here to my test site and it's working fine, it only appears to be a problem with the main forum site.

I changed the code and uploaded it to the main forum and it's fixed in the main forum now too. Thank you.

My question is, how come it worked in one site but not another? Could it have been some mod clash? I have the same mods in both forums. The test site is used to test the mods before I make them live for the users.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #37 on: May 18, 2010, 05:28:53 AM »
Is likely a mod clash. Not quite sure what went on though.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Chas Large

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,101
  • Gender: Male
  • Running 2.0.xx on Apache.
    • Chas.Large on Facebook
    • https://www.linkedin.com/in/charles-large-568ba213 on LinkedIn
    • @https://twitter.com/ on Twitter
    • Chas Large's Site
Re: Ignore Topics
« Reply #38 on: May 19, 2010, 04:02:49 AM »
Arantor Help!

Just discovered another bug. If I click the NEW Indicator on the forum index I get the following error:

Code: [Select]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IFNULL(it.id_topic, 0) = 0
AND t.id_last_msg > 143234
AND IFNULL(lt.id_m' at line 6
File: /home/nas05l/f/fiftyplusforum.co.uk/user/htdocs/forum/Sources/Recent.php
Line: 878

Clicking the NEW indicator on the unread and show new... lists works fine.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,042
    • Arantor on GitHub
Re: Ignore Topics
« Reply #39 on: May 19, 2010, 07:17:57 AM »
Recent.php
Code: (find) [Select]
$request = $smcFunc['db_query']('', '
SELECT COUNT(*), MIN(t.id_last_msg)
FROM {db_prefix}topics AS t' . (!empty($have_temp_table) ? '
LEFT JOIN {db_prefix}log_topics_unread AS lt ON (lt.id_topic = t.id_topic)' : '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})') . '
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = t.id_board AND lmr.id_member = {int:current_member})
'. ($can_ignore ? 'LEFT JOIN {db_prefix}ignore_topics AS it ON (it.id_topic = t.id_topic AND it.id_member = {int:current_member})' : '') .'
WHERE t.' . $query_this_board .
($can_ignore ? 'AND IFNULL(it.id_topic, 0) = 0' : '') .
($context['showing_all_topics'] && !empty($earliest_msg) ? '
AND t.id_last_msg > {int:earliest_msg}' : (!$context['showing_all_topics'] && empty($_SESSION['first_login']) ? '
AND t.id_last_msg > {int:id_msg_last_visit}' : '')) . '
AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < t.id_last_msg' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : ''),
array_merge($query_parameters, array(
'current_member' => $user_info['id'],
'earliest_msg' => !empty($earliest_msg) ? $earliest_msg : 0,
'id_msg_last_visit' => $_SESSION['id_msg_last_visit'],
'is_approved' => 1,
))
);

Code: (replace) [Select]
$request = $smcFunc['db_query']('', '
SELECT COUNT(*), MIN(t.id_last_msg)
FROM {db_prefix}topics AS t' . (!empty($have_temp_table) ? '
LEFT JOIN {db_prefix}log_topics_unread AS lt ON (lt.id_topic = t.id_topic)' : '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})') . '
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = t.id_board AND lmr.id_member = {int:current_member})
'. ($can_ignore ? 'LEFT JOIN {db_prefix}ignore_topics AS it ON (it.id_topic = t.id_topic AND it.id_member = {int:current_member})' : '') .'
WHERE t.' . $query_this_board .
($can_ignore ? '
AND IFNULL(it.id_topic, 0) = 0' : '') .
($context['showing_all_topics'] && !empty($earliest_msg) ? '
AND t.id_last_msg > {int:earliest_msg}' : (!$context['showing_all_topics'] && empty($_SESSION['first_login']) ? '
AND t.id_last_msg > {int:id_msg_last_visit}' : '')) . '
AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < t.id_last_msg' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : ''),
array_merge($query_parameters, array(
'current_member' => $user_info['id'],
'earliest_msg' => !empty($earliest_msg) ? $earliest_msg : 0,
'id_msg_last_visit' => $_SESSION['id_msg_last_visit'],
'is_approved' => 1,
))
);

vbgamer: Without being funny, was this mod actually tested when it was refitted for 2.0 RC3?
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.