News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Unable to delete old attachments

Started by clothahump, January 24, 2012, 05:38:58 AM

Previous topic - Next topic

Joker™

In attached Recent.php (Make backup of the file)

Code (Find:) Select
$context['topics_per_page'] = empty($modSettings['disableCustomPerPage']) && !empty($options['topics_per_page']) && !WIRELESS ? $options['topics_per_page'] : $modSettings['defaultMaxTopics'];


Code (Add after) Select
echo $context['topics_per_page'];

See the result value on left hand top corner.


SELECT
            ms.subject AS first_subject, ms.poster_time AS first_poster_time, ms.id_topic, t.id_board, b.name AS bname,
            t.num_replies, t.num_views, ms.id_member AS id_first_member, ml.id_member AS id_last_member,
            ml.poster_time AS last_poster_time, IFNULL(mems.real_name, ms.poster_name) AS first_poster_name,
            IFNULL(meml.real_name, ml.poster_name) AS last_poster_name, ml.subject AS last_subject,
            ml.icon AS last_icon, ms.icon AS first_icon, t.id_poll, t.is_sticky, t.locked, ml.modified_time AS last_modified_time,
            IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from, SUBSTRING(ml.body, 1, 385) AS last_body,
            SUBSTRING(ms.body, 1, 385) AS first_body, ml.smileys_enabled AS last_smileys, ms.smileys_enabled AS first_smileys, t.id_first_msg, t.id_last_msg
         FROM smf_messages AS ms
            INNER JOIN smf_topics AS t ON (t.id_topic = ms.id_topic AND t.id_first_msg = ms.id_msg)
            INNER JOIN smf_messages AS ml ON (ml.id_msg = t.id_last_msg)
            LEFT JOIN smf_boards AS b ON (b.id_board = t.id_board)
            LEFT JOIN smf_members AS mems ON (mems.id_member = ms.id_member)
            LEFT JOIN smf_members AS meml ON (meml.id_member = ml.id_member)
            LEFT JOIN smf_log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = 1)
            LEFT JOIN smf_log_mark_read AS lmr ON (lmr.id_board = t.id_board AND lmr.id_member = 1)
         WHERE t.id_board IN (1)
            AND t.id_last_msg >= 5
            AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < ml.id_msg
         ORDER BY t.id_last_msg DESC
         LIMIT 0, 1


Run this query in DB and replace 1 in "LIMIT 0, 1" with the value shown earlier.

Post the number of results obtained from DB and value echo'd by the first code.

Edit - Marking this topic as unsolved.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

clothahump

Do you mean replace "LIMIT 0, 1" with "LIMIT 0, 20"

Joker™

Quote from: Joker™ on January 31, 2012, 10:19:08 AM
In attached Recent.php (Make backup of the file)

Code (Find:) Select
$context['topics_per_page'] = empty($modSettings['disableCustomPerPage']) && !empty($options['topics_per_page']) && !WIRELESS ? $options['topics_per_page'] : $modSettings['defaultMaxTopics'];


Code (Add after) Select
echo $context['topics_per_page'];

See the result value on left hand top corner.
replace "LIMIT 0, 1" with "LIMIT 0, result_show_by_that_code"
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

clothahump

I must be having a very large blonde moment, that has gone straight over my head, best leave it as it is or can I just edit in phpmyadmin?

Joker™

Quote from: Joker™ on January 31, 2012, 10:19:08 AM
In attached Recent.php (Make backup of the file)

Code (Find:) Select
$context['topics_per_page'] = empty($modSettings['disableCustomPerPage']) && !empty($options['topics_per_page']) && !WIRELESS ? $options['topics_per_page'] : $modSettings['defaultMaxTopics'];


Code (Add after) Select
echo $context['topics_per_page'];

See the result value on left hand top corner.

Lets do this first ;). Try it and post the result here.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

clothahump


clothahump

REmoved echo $context['topics_per_page']; and font back to normal.

Joker™

I know, it's going to make font larger at some parts. I just wanted to know the value of the variable as it's on the one used in the query.

Can't access that page of your website as I don't have an account.

Moreover is this happening with everyone or just you?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

clothahump

I will find out and let you know tomorrow, need my bed as early start tomorrow.

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

clothahump

How embarrassing is this, why is it the blatantly obvious gets overlooked, I had set it in profile to 50 when I was trying to get rid of the attachments and forgot completely, sorry to have wasted your time.

Joker™

Nice to see that it got sorted out for you. Marking this topic as solved.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

SergeantAsh

Quote from: clothahump on January 24, 2012, 05:38:58 AM
Two Year ago we had a major server blip which deleted all attachments, I have learned to live with search engines trying to find non existent files ever since but today I decided to just delete all trace of every attachment before January the 1st 2010, I inserted 754 days in the pruning system and hit Remove only to get this error.

Unable to verify referring url. Please go back and try again.

I take it this is because the files no longer exists, can anybody help with how I can remove what no longer exists?

I've got this exact same issue in my newly upgraded 2.0.9 forum, any ideas on how to solve it as the other responses in this thread didn't seem to help?
Quote"Moderation has been called a virtue to limit the ambition of great men, and to console undistinguished people for their want of fortune and their lack of merit."

Advertisement: