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

merlin_de 12-19-2009 08:10 AM

Hello,
it works not in my cms. There is a Box with the title "Latest Picture", but without content. I have upload a new albumpicture, but nothing happens.
In the Template "cms_albums_almbumsbits" is a href to "album-picture.php". Where can i find this file ?
Greets,Micha

Allan 12-19-2009 08:16 AM

Do you have one screen please ?

merlin_de 12-19-2009 08:28 AM

Hello Allan,
many thanks for your answer. I can?t believe it: I had deleted the old (and incompatible) vB3 Styles in the ACP now, and it works:eek:. Maybee this will help other users who have problems with this nice widget.
However, here my screenshot from a working hack ;)

https://vborg.vbsupport.ru/external/2009/12/67.jpg

Greets,Micha

abroad 12-19-2009 10:01 AM

the pictures need to be larger...how is it possible to change it?

woffie 12-19-2009 11:12 AM

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

AWMGolfer 12-19-2009 11:43 AM

Is there a way this can work on the new forum sidebar?

AndrewSpearin 12-19-2009 09:28 PM

Thanks for this, I was able to adapt it to suit a needed feature perfectly :)

http://npac.ca/2010

abroad 12-23-2009 07:55 AM

there is a problem with pictures which are set to private. Those are not displayed. The album is only displayed empty. They need to be filtered out.

Massamo 12-23-2009 09:00 AM

This will fix the problem updated first post too

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 albumpicture.*, album.*, user.username, user.usergroupid,
  IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
  FROM " . TABLE_PREFIX . "attachment AS albumpicture
  LEFT JOIN " . TABLE_PREFIX . "album AS album ON(album.albumid = albumpicture.contentid)
  LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = album.userid)
  WHERE album.state = 'public' and albumpicture.contenttypeid = '8'
ORDER BY $orderby DESC LIMIT 0, $hm
  ");


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

    while ($lpicture = $db->fetch_array($lpictures))
    {
    $lpicture['musername'] = fetch_musername($lpicture);
    $lpicture['title'] = trim(strip_quotes($lpicture['title']));

   
$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;


abroad 12-23-2009 09:13 AM

thanks a lot!

kevinfx 01-02-2010 07:32 PM

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

thanks

Verionia 01-04-2010 12:28 AM

How do I display this as a block on the forum?

ARadarDetector 01-04-2010 02:27 AM

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!

gsipromotions 01-05-2010 01:49 PM

Quote:

Originally Posted by woffie (Post 1933398)
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.

worried 01-08-2010 09:19 AM

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.

kersti 01-09-2010 11:13 AM

How do I add in two new templates?

antua al toro 01-18-2010 02:28 PM

Quote:

Originally Posted by kersti (Post 1951060)
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

ahmedipa 01-23-2010 03:14 PM

thank you so much

Juggernaut 02-05-2010 04:44 AM

Thank you very much for this widget, it's awesome :D

aberg 02-05-2010 05:57 PM

Quote:

Originally Posted by abroad (Post 1933381)
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 (Post 1951060)
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

dancop 02-05-2010 10:54 PM

Is there a way to limit the widget to pull the pictures from the given album only not from all the albums?

Juggernaut 02-06-2010 01:58 AM

Yes the pictures are to small, but otherwise this is a good widget :D

dodgechargerfan 02-06-2010 05:38 PM

I like this a lot but I am seeing the same problem as others - the picture is smaller than the box so there's a lot of white background to look at.

Bergler 02-07-2010 12:08 AM

1 Attachment(s)
Like this,

Bergler 02-07-2010 02:02 AM

Quote:

Originally Posted by Bergler (Post 1976355)
Like this,

How do you fix that?

Moondust 02-07-2010 07:23 AM

I need the last 6 Pictures from ALL Pictures on my Forum.... and display it in the Forumhome under the Navbar.... please code this... many People miss this Addon :-)

Moondust 02-07-2010 07:36 AM

Its not work in 4.0.1 ? Only the Date see, but not a Picture.

Juggernaut 02-07-2010 07:45 AM

^^ It does work on 4.0.1, I have it in my forum, butthis is only for the homepage, it's not
for the navbar, you want New Album Picture Forum Home mod for that. :)

Moondust 02-07-2010 03:37 PM

Quote:

Originally Posted by Destron (Post 1976499)
^^ It does work on 4.0.1, I have it in my forum, butthis is only for the homepage, it's not
for the navbar, you want New Album Picture Forum Home mod for that. :)

This Widget is for the CMS, really... but is not work... show only the Date from today.


I am search a Mod for all Pictures, not only the Album Pictures :-)

Juggernaut 02-07-2010 04:18 PM

<i>^^ You have to make the template edit as swell, after you create the widget.
Yes a mod for all pictures would be great, and it would be awesome to have
a mod like that.</i>


All times are GMT. The time now is 06:03 AM.

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.01329 seconds
  • Memory Usage 1,817KB
  • 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
  • (4)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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