vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Gallery for vBulletin 3.5.X (https://vborg.vbsupport.ru/showthread.php?t=92875)

Necrosaro420 06-29-2006 09:58 PM

Quote:

Originally Posted by Harald_T
Just to add one important thing:

This hack is based on the "Thumbnail on Forumdisplay"-Hack, which was original written by Dechevious, so credits go also out to him.


Can user's submit there own pics?

Harald_T 06-30-2006 07:03 AM

Yes, they can. The only thing, the admin needs, is to setup a forum for the user and create a gallery out of it.

ltaylor 06-30-2006 12:00 PM

*clicked installed*! I'll be back with a review once installed.
Thanks for creating and sharing!!

kofoid 06-30-2006 09:40 PM

Help!

godaddy shut my site down due to this mod :(:(:( and it's so so awesome! It seems that the following queries caused Go Daddy's CPU utilization soar to over 80% and almost brought down the entire shared server:

Quote:

SELECT gallery, threadid, firstpostid, Yadathread.title, attachmentid, Yadaattachment.dateline FROM Yadaattachment, Yadathread, Yadaforum
WHERE gallery='1' AND Yadathread.featured!='1' AND Yadathread.forumid=Yadaforum.forumid AND Yadathread.firstpostid = Yadaattachment.postid AND Yadaattachment.dateline < 1151690651
GROUP BY Yadathread.threadid
ORDER BY Yadaattachment.attachmentid DESC LIMIT 5 |
SELECT gallery, threadid, firstpostid, Yadathread.title, attachmentid, Yadaattachment.dateline FROM Yadaattachment, Yadathread, Yadaforum
WHERE gallery='1'AND Yadathread.featured!='1' AND Yadathread.forumid=Yadaforum.forumid AND Yadathread.firstpostid = Yadaattachment.postid AND Yadaattachment.dateline < 1151690653 ORDER BY RAND() LIMIT 5 |

SELECT gallery, threadid, firstpostid, Yadathread.title, attachmentid, Yadaattachment.dateline FROM Yadaattachment, Yadathread, Yadaforum
WHERE gallery='1' AND Yadathread.featured!='1' AND Yadathread.forumid=Yadaforum.forumid AND Yadathread.firstpostid = Yadaattachment.postid AND Yadaattachment.dateline < 1151690653
Can anyone let me know what I can do in order to KEEP this mod on my site? It seems that the above queries are the forumhome ones for the display 5 random images option.... is that right? If so, is there ANY way I can get this to work without as many queries?

Harald_T 06-30-2006 10:15 PM

@Kofoid: I'm aware of this problem, also it should only add some queries to the page, but not that much, that the site breaks down. I'm thinking over this, if i can reduce the amount of queries used in these routines.

kofoid 07-01-2006 01:38 PM

Thanks Harald!! You rock! :)

ltaylor 07-01-2006 04:00 PM

Hi Harold & Everyone,

First, the hack is awesome. I installed it last night. I have a few changes to make to imput link on navbar as I've also just recently installed a custom skin..(need to work with the coding).

Anyways, one problem I'm having is showing the latest gallery additions in the user cp. I am in the midst of searching all the posts in this thread to find the answer, but in the event someone knows..it would be great if you could direct me.

Thankyou!

Necrosaro420 07-02-2006 12:19 AM

Quote:

Originally Posted by Harald_T
Yes, they can. The only thing, the admin needs, is to setup a forum for the user and create a gallery out of it.

Is there an option so that I do not have to set it up for a specific user? I run a video gaming site, and I want to allow user's to post the pictures of the collections that they have, but I dont want to have to baby it and set each individual one up.

Thanks!

Harald_T 07-02-2006 08:52 AM

@Necrosaro: That would mean, that your users would be able to open up a gallery for themself. I have to check this, can't say atm.

Harald_T 07-02-2006 08:22 PM

@Kofoid: Try this code for the plugin: gallery_images_forumhome

Code:

// #################### Latest Gallery-Additions #######################
// fetch the permissions for each forum
// global $vbulletin;
if ($vbulletin->options['show_latest']) {
$gal_num_rows = $vbulletin->options['gal_num_rows'];


$thumbs = $db->query_read("SELECT gallery, threadid, firstpostid, ". TABLE_PREFIX . "thread.title, attachmentid, ". TABLE_PREFIX . "attachment.dateline FROM ". TABLE_PREFIX . "attachment, ". TABLE_PREFIX . "thread, ". TABLE_PREFIX . "forum
WHERE gallery='1' AND ". TABLE_PREFIX . "thread.forumid=". TABLE_PREFIX . "forum.forumid AND ". TABLE_PREFIX . "thread.firstpostid = ". TABLE_PREFIX . "attachment.postid AND ". TABLE_PREFIX . "attachment.dateline < " . TIME() ."
GROUP BY ".TABLE_PREFIX ."thread.threadid
ORDER BY ". TABLE_PREFIX . "attachment.attachmentid DESC LIMIT $gal_num_rows");



while ($gallery = $db->fetch_array($thumbs))
{
eval('$latestgallery .= "' . fetch_template('gallery_latestpictures') . '";');
}

}
// #################### Random Gallery-Additions #######################
// fetch the permissions for each forum
if ($vbulletin->options['show_random']) {
$random_thumbs = $db->query_read("SELECT gallery, threadid, firstpostid, ". TABLE_PREFIX . "thread.title, attachmentid, ". TABLE_PREFIX . "attachment.dateline FROM ". TABLE_PREFIX . "attachment, ". TABLE_PREFIX . "thread, ". TABLE_PREFIX . "forum
WHERE gallery='1'AND ". TABLE_PREFIX . "thread.featured!='1' AND  ". TABLE_PREFIX . "thread.forumid=". TABLE_PREFIX . "forum.forumid AND ". TABLE_PREFIX . "thread.firstpostid = ". TABLE_PREFIX . "attachment.postid AND ". TABLE_PREFIX . "attachment.dateline < " . TIME() ." ORDER BY RAND() LIMIT $gal_num_rows");

while ($rand_gallery = $db->fetch_array($random_thumbs))
{
eval('$random_gallery .= "' . fetch_template('gallery_randompictures') . '";');
}

}
$top5 = $db->query_read("SELECT gallery,". TABLE_PREFIX . "thread.featured, threadid, firstpostid, ". TABLE_PREFIX . "thread.title, attachmentid, ". TABLE_PREFIX . "attachment.dateline, ". TABLE_PREFIX . "thread.views FROM ". TABLE_PREFIX . "attachment, ". TABLE_PREFIX . "thread, ". TABLE_PREFIX . "forum
WHERE gallery='1' AND ". TABLE_PREFIX . "thread.featured!='1' AND ". TABLE_PREFIX . "thread.forumid=". TABLE_PREFIX . "forum.forumid AND ". TABLE_PREFIX . "thread.firstpostid = ". TABLE_PREFIX . "attachment.postid AND ". TABLE_PREFIX . "attachment.dateline < " . TIME() ." ORDER BY ". TABLE_PREFIX . "thread.views DESC LIMIT $gal_num_rows");

while ($top_gallery = $db->fetch_array($top5))
{
eval('$top5_gallery .= "' . fetch_template('gallery_top5') . '";');
}

// featured forum

$feat_rows=$gal_feat_rows;
$featured_thumbs = $db->query_read("SELECT ". TABLE_PREFIX . "thread.featured, threadid, firstpostid, ". TABLE_PREFIX . "thread.title, MAX(". TABLE_PREFIX . "attachment.attachmentid)AS attachmentid, ". TABLE_PREFIX . "attachment.dateline FROM ". TABLE_PREFIX . "attachment, ". TABLE_PREFIX . "thread, ". TABLE_PREFIX . "forum
WHERE ". TABLE_PREFIX . "thread.featured='1' AND ". TABLE_PREFIX . "thread.forumid=". TABLE_PREFIX . "forum.forumid AND ". TABLE_PREFIX . "thread.firstpostid = ". TABLE_PREFIX . "attachment.postid AND ". TABLE_PREFIX . "attachment.dateline < " . TIME() ."
GROUP BY ".TABLE_PREFIX ."thread.threadid
ORDER BY ". TABLE_PREFIX . "attachment.attachmentid DESC LIMIT $feat_rows");



while ($featured = $db->fetch_array($featured_thumbs))
{
eval('$featured_gallery .= "' . fetch_template('gallery_featured') . '";');
}

This will remove two queries, if those gallery-options are not used. Tell me, if it works, and i'll build up the whole plugin this way. This is just a workaround, no final solution for this problem. But it may help a bit.


All times are GMT. The time now is 01:23 PM.

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.02469 seconds
  • Memory Usage 1,762KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)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