The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Widget: display random image thumbnail from public albums Details »» | |||||||||||||||||||||||||||||
Widget: display random image thumbnail from public albums
Developer Last Online: Nov 2013
What it does ?
This widget displays a thumbnail image, taken randomly from any public albums and adds a "More..." link redirecting to albums. Clicking on the thumbnail opens full sized picture in its current album. Version history : 1.0: Initial release 1.1: Style can now be independant of template modification / Added option to display more than one thumbnail / Added option to define a custom size for the thumbnails. 1.2: You can now restrict picture fetching to a list of albums / Added fixes to the request. Install instructions : 1- Go in to your AdminCP > vBulletin CMS > Widgets > Create new widget 2- Choose type 'PHP direct execution' 3- Give it a name (i.e: Random Picture) 4- Give it a description (i.e Random picture from public albums) 5- Save it 6- Configure it with the following code (copy/paste) PHP Code:
PHP Code:
define a list of albums IDs (coma-separated list) to use, when taking a picture randomly. You can also specify only one ID. note: if you leave this variable empty, ALL public albums will be used. $use_vB_thumbnail_size : false = the widget will use $twidth to set up the width of the thumbnail. true = default vBulletin thumbnail size will be used. $twidth: Width of a thumbnail (in pixel.) will only be used if $use_vB_thumbnail_size is set to false. $limit: # of thumbnails you want to display in the widget. $use_custom_css false = the styling of widget elements will be performed inside the widget itself (using style="" html tag.) true = the styling will be performed by CSS, thus a template needs to be manually edited : vbcms.css Code:
.pthumb { text-align:center; } .pthumb img { border: 1px solid black; padding:4px; background: white; } .pcaption { text-align:center; font-style:italic; font-family: "Times New Roman", Times, serif; margin-bottom:10px; } .pmore { text-align:right; display:block; } Screenshot : see below. Screenshots
Show Your Support
|
Благодарность от: | ||
Haponing |
Comments |
#82
|
|||
|
|||
Quote:
Code:
// -- Nothing to configure below this line -- if ($use_custom_css){ $pthumb = 'class="pthumb"'; $pcaption = 'class="pcaption"'; $pmore = 'class="pmore"'; $pstyle = ''; }else{ $pthumb ='style="position: relative;float:left;padding-left:5px;padding-right:5px;padding-bottom:5px;margin-bottom:20px;margin-top:5px;"'; $pcaption = 'style="text-align:center;font-style:italic;font-family: Times, serif;margin-bottom:10px;"'; $pmore = 'style="text-align:right;display:block;"'; $pstyle = 'style="border: 1px solid black;padding:4px;background: white;"'; } Quote:
|
#83
|
||||
|
||||
possible to show them horizontal (e.g. 3 pictures in a row) instead of vertical?
|
#84
|
||||
|
||||
+1 Please.
|
#85
|
|||
|
|||
Thanks, great widget. works great on 4.1.10. To those who have problems with image not changing: check the configuration of the widget. The is a caching setting set to 5 minutes. If you want the image to change more often then that, you should change that setting. I think that is what happens. I think that will also allow for a "photo of the day" if you set the caching to 1440 minutes. or photoof the week if you go for 10080 minutes.
steve k. |
#86
|
||||
|
||||
Could this be used in forum sidebar too ? Is it same as CMS widget ?
|
#87
|
|||
|
|||
Yes, the code could be used for sidebar. Just create new php-block and paste the code in created block.
|
#88
|
|||
|
|||
Good!
I'd like to know how to display the latest uploaded picture? |
#89
|
|||
|
|||
Great little mod, thanks for sharing!
|
#90
|
|||
|
|||
Thanks for this! Can anyone show me where to edit to make it so instead of (name of photo) by (name of user) to just > by (name of user)
Some peoples photo names are quite long or just plain strange.. Thank You I found the line {$picture[caption_preview]} by {$pic[username]}</div>"; I deleated the [caption_preview] so it looks like {$picture} by {$pic[username]}</div>"; I like it better but on the widget under the photos it now says Array by Live_Bait I don't mind the word Array but it would be nice if it just said by Live_Bait Thanks if anybody has the right idea.. I will keep trying myself. Got it... {$picture [photo]} by {$pic[username]}</div>"; now it just says by Live_Bait I am sure the word photo could have been any word at all. |
#91
|
|||
|
|||
Quote:
I it possible to display the latest uploaded pics? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|