Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Photopost Pro Random Image Widget Details »
Photopost Pro Random Image Widget
Mod Version: 1.00, by ZippySLC (Member) ZippySLC is offline
Developer Last Online: Nov 2010 I like it Show Printable Version Email this Page

vB Version: 4.0.1 Rating: (7 votes - 4.71 average) Installs: 45
Released: 31 Jan 2010 Last Update: Never Downloads: 0
Not Supported Re-usable Code Translations  

Hey all,

One of the things that I missed from my transition from Drupal to vBCMS was my Photopost random image block. It's one of the features that my visitors seem to really like as well. After some trial and error, I managed to create a working vBCMS widget that utilizes the "Random Image Anywhere" code submitted by Garrynz on the Photopost site.

Now, I will say that I am not a huge fan of the way that Garrynz's code works (variables are defined in the code rather than looking at the config files), but it's a quick and dirty way to get this work. In no way are your database details visible to anybody, so don't worry - it's more of an aesthetic thing than a security thing.

Anyway, to utilize this widget, follow these steps:

1. Go into your AdminCP, vBulletin CMS, Widgets, and click on "Add New Widget"
2. Create a new widget of type "PHP Direct Execution" and name it what you want. This name gets used in the header of the widget. I chose "Random Image."
3. Paste the following code in, making changes for your specific environment:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Important Notes:
  • Make sure you make the widget be a "PHP Direct Execution" widget! If you don't, none of this will work!
  • Make sure you enter your database information correctly! Check your photopost config files if you've forgotten it. The correct syntax for the entries should be something like this:
    $host = 'localhost'; (with the entry in apostrophes and a semi-colon at the end)
  • If your Photopost tables don't have the pp_ prefix, you'll need to alter the code to reflect your prefix.
  • Make sure the URL to your gallery is set correctly after the print statement. In my case, since my gallery runs in a subdomain, my own print statement looks something like this:

    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  • The output is wrapped in a div that's centered. Feel free to change that to your liking.
  • Again, this will not run out of the box without some customization on your part! But I hope it's fairly straightforward to understand.
  • SEO vs Non-SEO Friendly URL's:
    Photopost lets you use "Spider-Friendly URL's." There's three different options, spider, SEO, and none. I personally use spider on my Photopost site and the code I have above works fine. If you have your URL's set to "none" you'll need to use slightly different code. In that case, use this alternate print statement. (Replace the one in the code above with this, and obviously adjust the paths to match your specific install.)

    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.


You can see this widget in action on my site, http://www.njpinebarrens.com

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 31 Jan 2010, 08:11
Froggfish Froggfish is offline
 
Join Date: Oct 2006
Is this for Photopost Callery og for Photopost Pro?
Reply With Quote
  #3  
Old 31 Jan 2010, 11:03
tazattitude's Avatar
tazattitude tazattitude is offline
 
Join Date: Dec 2009
Real name: Scott F
Actually, there is a file that you can download from Photopost, and re-upload in your "Gallery". Then you run it from your Gallery cp. This will create a "product" file that you upload in your vb products section.
This will create a thumbnail strip that you can specify weather you want newest or newest pics. Plus the amount of images you want to show up.
You can make the changes in the Plugin section.
You can see how I have 6 images are 'random' on my website


This of course, if it's Photopost Gallery
Reply With Quote
  #4  
Old 31 Jan 2010, 11:42
ZippySLC's Avatar
ZippySLC ZippySLC is offline
 
Join Date: Oct 2004
Froggfish,

Photopost Pro, but it might work for regular Photopost (vBGallery) as well.

Taz,

I saw their plugin, but I don't think that works on the CMS side. Additionally, it takes up a lot of space. This is just a quick and dirty way to display one random image and be done with it.

Your site design is very nice, by the way.

Last edited by ZippySLC; 31 Jan 2010 at 15:27.
Reply With Quote
  #5  
Old 31 Jan 2010, 17:50
MattZ DSLR MattZ DSLR is offline
 
Join Date: Dec 2008
OK
What am I doing wrong
My site takes a very long time to load in


Template Name???
vbcms_widget_execphp_page

Last edited by MattZ DSLR; 31 Jan 2010 at 17:57.
Reply With Quote
  #6  
Old 31 Jan 2010, 18:14
ZippySLC's Avatar
ZippySLC ZippySLC is offline
 
Join Date: Oct 2004
You can leave the template name as the default vbcms_widget_execphp_page.

What is the URL to your site?
Reply With Quote
  #7  
Old 31 Jan 2010, 18:33
MattZ DSLR MattZ DSLR is offline
 
Join Date: Dec 2008
Pm Send

Last edited by MattZ DSLR; 31 Jan 2010 at 21:22.
Reply With Quote
  #8  
Old 31 Jan 2010, 18:46
ZippySLC's Avatar
ZippySLC ZippySLC is offline
 
Join Date: Oct 2004
I don't see the random image widget on your CMS.
Reply With Quote
  #9  
Old 31 Jan 2010, 19:07
MattZ DSLR MattZ DSLR is offline
 
Join Date: Dec 2008
I took it out as home page wouldn't load
Reply With Quote
  #10  
Old 31 Jan 2010, 19:25
ZippySLC's Avatar
ZippySLC ZippySLC is offline
 
Join Date: Oct 2004
Wouldn't load at all, or would load very slowly?
Reply With Quote
  #11  
Old 31 Jan 2010, 19:43
MattZ DSLR MattZ DSLR is offline
 
Join Date: Dec 2008
OK the link works but there is no photo
Do you know y this could be?
Reply With Quote
  #12  
Old 31 Jan 2010, 19:54
ZippySLC's Avatar
ZippySLC ZippySLC is offline
 
Join Date: Oct 2004
Send me a PM with the code you're using. (Edit out your database information)

I'll take a look.
Reply With Quote
  #13  
Old 31 Jan 2010, 20:24
MattZ DSLR MattZ DSLR is offline
 
Join Date: Dec 2008
PM send
Reply With Quote
  #14  
Old 31 Jan 2010, 20:50
ZippySLC's Avatar
ZippySLC ZippySLC is offline
 
Join Date: Oct 2004
Thanks.

Two things:

1. Is the table prefix for your gallery pp_
2. It might also be because your images are not viewable by unregistered users, but I'm not quite sure.
Reply With Quote
  #15  
Old 31 Jan 2010, 20:53
MattZ DSLR MattZ DSLR is offline
 
Join Date: Dec 2008
Thank you
Can you delete my code
I will keep you posted
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 03:44.

Layout Options | Width: Wide Color: