Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Latest Album Picture v2 Details »»
Latest Album Picture v2
Version: 0.3, by Massamo Massamo is offline
Developer Last Online: Apr 2022 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.3 Rating:
Released: 12-13-2009 Last Update: Never Installs: 63
Template Edits
Re-useable Code Translations Is in Beta Stage  
No support by the author.

Create a new widget
Widget Type: PHP Direct Execution
Title: Latest Picture

Then save find it again and click the configure change top box to
Code:
global $db;

// set how many to display
$hm = '1';

// replace dateline below with rand(NOW()) if you want it random
$orderby = "dateline";


$lpictures = $db->query_read("
  SELECT *  FROM " . TABLE_PREFIX . "attachment AS attach
    WHERE attach.state = 'visible' and attach.contenttypeid = '1'
ORDER BY $orderby DESC LIMIT 0, $hm
  ");

    $cols = $db->num_rows($lpictures);

    while ($lpicture = $db->fetch_array($lpictures))
    {
    
$templater = vB_Template::create('cms_albums_albumsbits');
$templater->register('lpicture' , $lpicture);
$albumpics .= $templater->render();

$templater = vB_Template::create('cms_albums');
$templater->register('lpicture' , $lpicture);
$templater->register('albumpics' , $albumpics);
$cms_albums = $templater->render();

    }
$output = $cms_albums;
Then save

add 2 new templates below

Title: cms_albums
Code:
    <link rel="stylesheet" type="text/css" href="css.php?styleid=1&amp;langid=1&amp;d=1260794007&amp;td=ltr&amp;sheet=album.css" />

    <link rel="stylesheet" type="text/css" href="css.php?styleid=1&amp;langid=1&amp;d=1260794007&amp;td=ltr&amp;sheet=picture.css" />

<div class="block" id="album">
    <ol id="thumbnails" class="blockbody floatcontainer">
        $albumpics
</ol>    
</div>
Title: cms_albums_albumsbits
Code:
<li>

    <center><a class="picture" href="$vboptions[bburl]/attachment.php?attachmentid=$lpicture[attachmentid]"><img src="$vboptions[bburl]/attachment.php?attachmentid=$lpicture[attachmentid]" alt="$lpicture[caption]" border="0" height="100" width="200"  /></a></center>
</li>
all you need to do now is go into layout manager and add the widget where you want it

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-02-2010, 07:32 PM
kevinfx kevinfx is offline
 
Join Date: Jan 2006
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do i display pix in 2 column (side by side like this : pix 1 | pix 2

thanks
Reply With Quote
  #23  
Old 01-04-2010, 12:28 AM
Verionia Verionia is offline
 
Join Date: Jul 2009
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I display this as a block on the forum?
Reply With Quote
  #24  
Old 01-04-2010, 02:27 AM
ARadarDetector ARadarDetector is offline
 
Join Date: Oct 2009
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added this to my cms homepage: http://www.Radar-Detector.net

As you can see the pictures don't fill that box up fully, I went into template to make the edit to make it bigger not sure which one i need to increase? How would I make the preview images seen on my homepage appear bigger to fill out the boxes more?

Thanks!
Reply With Quote
  #25  
Old 01-05-2010, 01:49 PM
gsipromotions gsipromotions is offline
 
Join Date: Feb 2006
Location: London Ontario Canada
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by woffie View Post
I get an error when I use this.

Fatal error: Call to a member function query_read() on a non-object in /home/myforums/public_html/myforums/forums/packages/vbcms/widget/execphp.php(171) : eval()'d code on line 6
Yep, I got that as well.
Reply With Quote
  #26  
Old 01-08-2010, 09:19 AM
worried worried is offline
 
Join Date: Jan 2009
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The center tag in your script isn't working for me. I think there is css from the album.css or picture.css that fixes the left margin. However, I see ARadarDetector's is centered perfectly. I have mine installed in vB 4.0 Gold.
Reply With Quote
  #27  
Old 01-09-2010, 11:13 AM
kersti kersti is offline
 
Join Date: Dec 2005
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I add in two new templates?
Reply With Quote
  #28  
Old 01-18-2010, 02:28 PM
antua al toro antua al toro is offline
 
Join Date: Apr 2009
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kersti View Post
How do I add in two new templates?
+1
i wonder
maybe i don't get it, spend 3 hours and didn't find how to add new templates.
help, please
Reply With Quote
  #29  
Old 01-23-2010, 03:14 PM
ahmedipa ahmedipa is offline
 
Join Date: Feb 2009
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you so much
Reply With Quote
  #30  
Old 02-05-2010, 04:44 AM
Juggernaut Juggernaut is offline
 
Join Date: Dec 2009
Location: California
Posts: 589
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much for this widget, it's awesome
Reply With Quote
  #31  
Old 02-05-2010, 05:57 PM
aberg aberg is offline
 
Join Date: Jul 2004
Location: Netherlands
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by abroad View Post
the pictures need to be larger...how is it possible to change it?
That's my question to, but there is no answer yet.
Is there someone who knows a solution?

Quote:
Originally Posted by kersti View Post
How do I add in two new templates?
In the admin menu go to Styles & Templates.
Click on Style Manager
In the drop down menu click on Add New Template.
If you have more styles you must add templates for each style
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 04:57 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.10596 seconds
  • Memory Usage 2,323KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete