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 - Latest Album Picture v2 (https://vborg.vbsupport.ru/showthread.php?t=230192)

Massamo 12-13-2009 10:00 PM

Latest Album Picture v2
 
1 Attachment(s)
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

Cees 12-14-2009 07:13 PM

Hi, searched for Widget Type: PHP Direct Execution, but couldnt find it. Maybe im in the wrong place , but im going to the widgetmanager choose new widget and then select Widget Type: PHP Direct Execution? Its not in the dropdown. (using Rc2)

Massamo 12-15-2009 03:02 AM

have you updated all the way to rc2 without uploading new php files? it may not be in old files not to sure

yilmaz 12-15-2009 06:14 AM

Quote:

Originally Posted by Cees (Post 1930714)
Hi, searched for Widget Type: PHP Direct Execution, but couldnt find it. Maybe im in the wrong place , but im going to the widgetmanager choose new widget and then select Widget Type: PHP Direct Execution? Its not in the dropdown. (using Rc2)

Clear the cache

ArcadeSyndicate 12-15-2009 08:56 AM

thank you, works fine :cool:

worried 12-15-2009 10:01 AM

This will definitely be my first vB 4.0 mod. I'll add this once 4.0 is officially released.

Cees 12-16-2009 06:59 AM

That did it, works great. Thanks!

abroad 12-16-2009 03:16 PM

Where can I change the background of each picture? I want to decrease the height of the white box behind the picture so that it has a similar size as the picture. Is this a specific CSS file? Where can I find it?

ThorstenA 12-16-2009 08:41 PM

I think the album permissions are not queried. It's important to not show private albums to the user. It would be nice if I could look at a "friend only" album when I am the friend of that user, of course users that are not befriended with the album author should not be shown the image.

Massamo 12-17-2009 12:45 AM

look into that sometime today it and it uses album.css and picture.css someones the album system uses


All times are GMT. The time now is 11:24 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.01052 seconds
  • Memory Usage 1,738KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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