vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Import External Images (https://vborg.vbsupport.ru/showthread.php?t=253309)

sticky 01-24-2011 09:55 AM

Quote:

Originally Posted by y2ksw (Post 2153741)
You may change the task code (query) in order to limit it to certain forum sections. I believe I never will add an option for selecting forum ID's since to my opinion it does not make much sense to import only images for a few sections.

Please add this option, it would be huge for me in particular :)

vortodox 01-24-2011 10:54 AM

Quote:

Originally Posted by y2ksw (Post 2153741)
You may change the task code (query) in order to limit it to certain forum sections. I believe I never will add an option for selecting forum ID's since to my opinion it does not make much sense to import only images for a few sections.

Actually it has allot sense, in my case there are some SPAM forumus in which members post many humoristic picts which I don't whish on my server, but on the other hand there are review with pictures which i really wish to have on my server.

Anyway, how do I change task code? /noob here :erm:


Quote:

Originally Posted by sticky (Post 2153744)
Please add this option, it would be huge for me in particular :)

Seconded.

BirdOPrey5 01-24-2011 12:20 PM

Just for the info of those who may need this feature, I made this edit for it to not import images from 2 specific forums... I am releasing this for info only, I don't recommend you make this change nor will I support it.

In ie_cron.php file I changed:

Code:

"SELECT postid, dateline, pagetext, forumid
    FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (post.threadid = thread.threadid
    WHERE iei_parsed=0
        AND pagetext LIKE '%[/IMG]%'
    ORDER BY postid";

to:
Code:

$SQL = "SELECT postid, " . TABLE_PREFIX . "post.dateline, pagetext, forumid
    FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (" . TABLE_PREFIX . "post.threadid = " . TABLE_PREFIX . "thread.threadid)
    WHERE iei_parsed = 0
        AND pagetext LIKE '%[/IMG]%' AND forumid != 2 AND forumid != 4
    ORDER BY postid";

This would import images from all forums EXCEPT forum id 2 and forum id 4 which were my off-topic and a private forum on my setup.

BadgerDog 01-24-2011 01:49 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2153797)
Just for the info of those who may need this feature, I made this edit for it to not import images from 2 specific forums... I am releasing this for info only, I don't recommend you make this change nor will I support it.

Thanks, but I think you need to clarify which version you're using?

I'm using the current 1.0.2 and my ie_cron.php file shown below does not have the additional ", forumid" on end of the $SQL string to search for?

Quote:

$SQL = "SELECT postid, dateline, pagetext
FROM " . TABLE_PREFIX . "post
WHERE iei_parsed=0
AND pagetext LIKE '%[/IMG]%'
ORDER BY postid";
Regards,
Doug

BirdOPrey5 01-24-2011 05:35 PM

Quote:

Originally Posted by BadgerDog (Post 2153835)
Thanks, but I think you need to clarify which version you're using?

I'm using the current 1.0.2 and my ie_cron.php file shown below does not have the additional ", forumid" on end of the $SQL string to search for?



Regards,
Doug

I'm using the current version, whatever it is, I just downloaded it recently. I know there is no forumid in the ORIGINAL code (which I specified in my post) I ADDED the forumids and a JOIN statement in my code which is the second block of code in my post.

My point is to change the original code to the new code I specified.

BadgerDog 01-24-2011 05:45 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2153941)
I'm using the current version, whatever it is, I just downloaded it recently. I know there is no forumid in the ORIGINAL code (which I specified in my post) I ADDED the forumids and a JOIN statement in my code which is the second block of code in my post.

My point is to change the original code to the new code I specified.

Thanks... :)

I'll ignore you find part of the code search and just use the replace part .. :up:

If I use a ForumID that has sub-forums, does that mean ALL sub-forums will be ignored too?

Appreciate your efforts... :)

Regards,
Doug

BirdOPrey5 01-24-2011 06:20 PM

No it doesn't cover subforums, each forumid must be entered manually. You can add more ANDs or consult a mysql manual for a better query.

y2ksw 01-24-2011 06:31 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2153961)
No it doesn't cover subforums, each forumid must be entered manually. You can add more ANDs or consult a mysql manual for a better query.

Better query :)
Code:

$SQL = "SELECT postid, " . TABLE_PREFIX . "post.dateline, pagetext, forumid
    FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (" . TABLE_PREFIX . "post.threadid = " . TABLE_PREFIX . "thread.threadid)
    WHERE iei_parsed = 0
        AND pagetext LIKE '%[/IMG]%'
        AND NOT forumid IN (1, 2, 3)
    ORDER BY postid";

The IN clause holds all forums to exclude. Contrarily:
Code:

$SQL = "SELECT postid, " . TABLE_PREFIX . "post.dateline, pagetext, forumid
    FROM " . TABLE_PREFIX . "post join " . TABLE_PREFIX . "thread on (" . TABLE_PREFIX . "post.threadid = " . TABLE_PREFIX . "thread.threadid)
    WHERE iei_parsed = 0
        AND pagetext LIKE '%[/IMG]%'
        AND forumid IN (4, 5, 6)
    ORDER BY postid";

The IN clause holds all forums to include.

As always, please try first in a sandbox ;)

BirdOPrey5 01-24-2011 06:41 PM

I want to suggest one more change I've used successfully on my test forum that may be of use to people with established forums.

In that query change ORDER BY postid to ORDER BY postid DESC so that the newest threads are processed first since it might take days or weeks to process a large existing forum.

BadgerDog 01-24-2011 07:54 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2153975)
I want to suggest one more change I've used successfully on my test forum that may be of use to people with established forums.

In that query change ORDER BY postid to ORDER BY postid DESC so that the newest threads are processed first since it might take days or weeks to process a large existing forum.

Wouldn't it be better to process the oldest threads first, simply because users who fail to renew their off-site storage, or their free 30 day trials run out, would get those pics moved internally first so there's less chance of ending up with missing pics when that happens? :confused:

By the way, thanks for the tips .. :)

Regards,
Doug


All times are GMT. The time now is 12:47 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02714 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete