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 - Widget: Latest Articles In Section (https://vborg.vbsupport.ru/showthread.php?t=232443)

Mark4865 03-06-2011 09:08 AM

does anyone know how I could use this to display recent videos which I created by putting embed code into static pages in sections.

what would I need to change in the code, all help appreciated

Mark4865 03-09-2011 05:37 AM

Using code below I managed to move image to the left and tried to move text to the right but it still appears underneath image instead of next to it, how do I fix this

// Set Your Section ID Here
$section = '1';
// Set The Number of Articles To Display
$limit = '5';
// Set The Height of The Thumbnail Image
$height = '100';
// Set The Width of The Thumbnail Image
$width = '150';

$articlegrab = vB::$db->query_read("
SELECT ".TABLE_PREFIX."cms_nodeinfo.nodeid
, ".TABLE_PREFIX."cms_nodeinfo.title
, ".TABLE_PREFIX."cms_article.previewimage
, ".TABLE_PREFIX."cms_article.contentid
, ".TABLE_PREFIX."cms_node.nodeid
, ".TABLE_PREFIX."cms_node.parentnode
, ".TABLE_PREFIX."cms_node.contentid
, ".TABLE_PREFIX."cms_node.url
, ".TABLE_PREFIX."cms_node.setpublish
FROM ".TABLE_PREFIX."cms_article
, ".TABLE_PREFIX."cms_nodeinfo
, ".TABLE_PREFIX."cms_node
WHERE (".TABLE_PREFIX."cms_nodeinfo.nodeid = ".TABLE_PREFIX."cms_node.nodeid)
AND (".TABLE_PREFIX."cms_article.contentid = ".TABLE_PREFIX."cms_node.contentid)
AND (".TABLE_PREFIX."cms_node.parentnode IN ($section))
AND (".TABLE_PREFIX."cms_node.setpublish != 0)
ORDER BY ".TABLE_PREFIX."cms_node.publishdate DESC LIMIT $limit
");

while($articleinfo = vB::$db->fetch_array($articlegrab)) {

$title = $articleinfo['title'];
$image = $articleinfo['previewimage'];
$nodeid = $articleinfo['nodeid'];
$url = $articleinfo['url'];
$fulltext = strip_bbcode($fulltext);
$text = preg_replace('/\[ATTACH\=CONFIG\]\d\d\[\/ATTACH\]/', '', $text);
$text = strip_bbcode($text);

if($text == '') $text = substr($fulltext, 0,150);

$output .= '<left>';
if($image != '') $output .= "<img src='".$image."' width='".$width."px' height='".$height."px' /><br />";

$output .= "<a href='content.php?".$nodeid."-".$url."'>".$title."</a><br /></br></right><p>".$text." </p><br />";
}

sandyss 03-16-2011 04:54 PM

HI Guys. I'm New and I'm looking for a plugin that show the lastest article insert into a section.
I tried to use this, but it doesn't go. I want to ask where is the number of section?
I have at the moment 2 section. I must to put the number or the name of my section in "// Set Your Section ID Here $section = '28';"
I want to put this widget in my home page. And I would like to put this widget in orizontal, like it is a footer.
May you help me? Thanks a lot.

Mark4865 03-16-2011 07:57 PM

Hello Sandyss,

to find your section id go to the section and look at the url see below

How do I find my section id?
When clicking on your section you should see something like this:

http://www.domain.com/content.php?11
The number after ? in this case 11 is your section id.

Can I enter more than one section id?
Yes simply change $section = '11' to something like $section='11, 12, 13'

sandyss 03-17-2011 08:57 AM

Hi Mark!!!
I have antoher problem because I cannot insert php code in a wdiget.
Because when I open agai the widget i see that the code isn't saved.
Why?
I cannt save php code? But I can't understand why!!!

Mark4865 03-17-2011 09:21 AM

Hello,

I am no expert so you are really asking advice from the wrong person but here goes.

When you create a widget you need to then save it and go to configure widget on the right hand side. Remove the exsisting code in the widget that is already in there when you create a new widget and just copy and paste in the new code and save that should be perfect.

sandyss 03-17-2011 09:39 AM

HI Mark. I asked to vbullettin.com directly.
I hope to resolve the problem. This widget is important for my web site

Thaks a lot!!!v :)

sandyss 03-18-2011 11:12 AM

1 Attachment(s)
Hi guys. I need help
FInally i can put php code in my widjet.
I want to know how can i do to see section article divided i three column.
In this moment i see the artcles section in row and not in column.
I attach the screenshot

Mark4865 03-18-2011 11:44 AM

Quote:

Originally Posted by sandyss (Post 2174708)
Hi guys. I need help
FInally i can put php code in my widjet.
I want to know how can i do to see section article divided i three column.
In this moment i see the artcles section in row and not in column.
I attach the screenshot

Hello,

Using your layout manager where have you place the widget, I could be wrong here but it looks like you have it under the main content block instead of on the sidebar. If I am right move it to the sidebar section and see if that fixes your problem.

sandyss 03-18-2011 11:49 AM

1 Attachment(s)
Hi Mark.
Exactly, I placed it under the main content, bacause I need an horizontal widget:
I nees this widget because it reas lastes artcile section.
But graphically I wolud like to be appear like this screenshot I have made with photoshop.
Take a look, please.
May you help me to create one like ths?


All times are GMT. The time now is 09:33 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.01893 seconds
  • Memory Usage 1,741KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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