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)
-   -   vBulletin CMS Widgets - Photopost Pro Random Image Widget (https://vborg.vbsupport.ru/showthread.php?t=234589)

phkk 03-11-2010 04:47 PM

how can i let the output appear on new winprint "<div align=\"center\"><a href=\"photos/showphoto.php/photo/" . $row['id'] . "\"><img src=\"photos/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . "\"></a><br /><a href=\"/gallery\">See more photos in the Gallery</a></div>"; dows, new frame.

ZGeek 03-12-2010 12:45 AM

Just in case anyone needs it. I've modified the query to exclude a category I have for NSFW images. This was based on help from the photopost forums. Thought I would share.

Change
Code:

$result = mysql_query("SELECT id,cat,bigimage FROM pp_photos order by rand() LIMIT 1" ) or die(mysql_error());
to
Code:

$result = mysql_query("SELECT id,cat,bigimage FROM pp_photos WHERE approved=1 AND cat NOT IN (502) order by rand() LIMIT 1" ) or die(mysql_error());
Just change the 502 to the category number you want to exclude. You should be able to add extra categories by adding numbers like so (502,503,504,505). But I am a n00b with php so I could be wrong.

wampforum 03-13-2010 06:22 AM

hmm couldnt get this to show an actual picture - just the 'more pictures in the gallery' (the link of which worked ok)
shame

Wild Bronco 03-27-2010 07:45 PM

I have 4 images in a horizontal line

Is it possible to show images in vertical line rather than horizontal?

Wild Bronco 03-28-2010 08:17 PM

I have tried to change the div align code

and a few other things but I can't find the right way.

Heldenverband 03-29-2010 07:25 AM

It works as VBCMS Modul at HERE

antboy 04-11-2010 03:10 AM

ZippySLC - thanks for such a nice little hack works as described no problems

couple of things

1) i have found that i can increase the number of images shown by changing LIMIT to a higher number

this is great but i would love to have the images shown horizontally - is this possible ??

2) i also tried changing the order from random to date but strangely it showed it in the reverse order with the oldest images in the database showing first -

regards and thnx again Anthony

msolano 11-03-2010 08:11 PM

If you are usign SEO in "Spider-Friendly URL's" you have to change the Select and the href code:

Code:

SELECT p.id,p.user,p.userid,p.cat,p.bigimage,p.title,c.catname,c.photos,c.posts
FROM pp_photos p LEFT JOIN pp_categories c ON c.id = p.cat
WHERE p.storecat = 0
AND p.cat NOT IN (500)
ORDER BY RAND()
LIMIT 1

And the href:

Code:

print "<div align=\"center\">
<a href=\"gallery_url/g" . $row['cat'] . "-" . $row['catname'] . ".html\">
<img  ...

I'm not php programmer but I know about programming :) and I used the code from vb profile integration published in photopost official site.

It works in my site about aquariums

pankaj1980 11-23-2010 05:47 AM

Hi,

I am a newbie and want to use your widget. I have followed the steps as mentioned by you but i don't have Photopost tables. From where i can get this tables. Please help me on this.

Regards,
Pankaj

tattooz 01-08-2011 08:27 PM

I was messing around with this code today and was able to get the widget to show HORIZONTALLY. Here is what I got and if you want to see it in action, visit http://www.modificationnation.com/ and under the big banner in the center you will see random members then FRESH INK & MODS.

You will need to add your database info at the top and change DOMAIN.COM to your URL. It should work no matter what your seo url's are set to but I don't know for sure. I have it set up to pull the newest photos from the gallery. If you would like it to pull random simply change "order by id DESC" to "order by rand()"

I am no coder, so I will do my absolute best to help you if it doesn't work

Code:

$host  = 'localhost';
$dbUser = 'DATABASE USER'; 
$dbPass = 'DATABASE PASSWORD';
$db = 'DATABASE NAME';
mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());

ob_start();

$result = mysql_query("SELECT id,cat,bigimage FROM pp_photos order by id DESC LIMIT 8") or die(mysql_error());
print "<table align=\"center\" border=\"3\" bordercolor=\"black\" cellpadding=\"10\"><tr>"; 
while($row = mysql_fetch_array( $result )) {   
print "<td><div align=\"center\"><a href=\"http://DOMAIN.COM/showphoto.php/photo/" . $row['id'] . "\"><img src=\"http://DOMAIN.COM/data/" . $row['cat'] . "/thumbs/" .  $row['bigimage'] . "\" width=\"100px\" height=\"100px\"></a></div></td>";
}

print "</tr></table>";
$output .= ob_get_contents();
ob_end_clean();



All times are GMT. The time now is 02:44 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.01357 seconds
  • Memory Usage 1,741KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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