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
[WIDGET] Slider Details »»
[WIDGET] Slider
Version: 1.00, by cory_booth cory_booth is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.1 Rating:
Released: 01-22-2010 Last Update: Never Installs: 157
Re-useable Code Additional Files Is in Beta Stage  
No support by the author.

Widget Slider - Frontpage Slide Show.

Demo: http://demo.webdeveloperplus.com/fea...ontent-slider/

This is based on the demo above. OK this is my first mod and I know the coding really sucks! But I thought I would get this out and see if anyone want to improve on it.
This is one of those frontpage slide shows that pulls your attachment and data from specified forums.

I hope this works for you.

Install:

Edit slider.php and at line 100:

$forumid - set the forum to pull slides
$limit - set the number of posts
$chars - set the total number of characters
$words - set total number of words

Upload Files.

Create PHP Widget and inser the following code:

ob_start();
echo '<div>';
echo '<center>';
require_once './clientscript/slider/slider.php';
echo '</center>';
echo '</div>';
$output=ob_get_contents();
ob_end_clean();

Download Now

File Type: zip slider.zip (4.1 KB, 2467 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
SyRiAn BoY

Comments
  #292  
Old 08-13-2011, 01:56 PM
Wordplay Wordplay is offline
 
Join Date: Nov 2001
Location: Dengoku
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

whoops error
Reply With Quote
  #293  
Old 08-14-2011, 12:41 AM
DS MrSinister DS MrSinister is offline
 
Join Date: Dec 2002
Location: the burgh
Posts: 553
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not sure why the tabs are showing on the left hand side.. it must be your CSS.. with out looking at your css code in the slider.php file. so please post your css code.

Sin
Reply With Quote
  #294  
Old 08-14-2011, 06:09 AM
Wordplay Wordplay is offline
 
Join Date: Nov 2001
Location: Dengoku
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i don't mind that it's on the left anymore, it can stay there, i just want to get rid of the space between the column with the thumbs and the actual image.

and can you help me make the descripton align on the left rather than center, and make it take away 600px rather than what it is taking away right now?


Code:
<style>
#featured{
	width:830px;
	padding-right:0px;
	position:relative;
	border:0px solid #ccc;
	height:350px;
	background:#fff;
}
#featured ul.ui-tabs-nav{
	position:absolute;
	top:0; left:0px;
	list-style:none;
	padding:0; margin:0;
	width:200px;
}
#featured ul.ui-tabs-nav li{
	padding:0px 0; padding-left:3px;
	font-size:10px;
	color:#666;
}
#featured ul.ui-tabs-nav li img{
	float:left; margin:2px 5px;
	background:#fff;
	padding:0px;
	border:1px solid #eee;
}
#featured ul.ui-tabs-nav li span{
	font-size:10px; font-family:Verdana;
	line-height:18px;
    border-color: #000;
}
#featured li.ui-tabs-nav-item a{
	display:block;
	height:70px;
	color:#333;  background:#fff;
	line-height:20px;
}
#featured li.ui-tabs-nav-item a:hover{
	background:#f2f2f2;
}
#featured li.ui-tabs-selected{
	background:url('images/selected-item.gif') top left no-repeat;
}
#featured ul.ui-tabs-nav li.ui-tabs-selected a{
	background:#ccc;
}
#featured .ui-tabs-panel{
	width:400px;
    height:350px;
	background:#999; position:relative;
}
#featured .ui-tabs-panel .info{
	position:absolute;
	top:180px; left:0;
	height:70px;
	background: url('images/transparent-bg.png');
    color:#fff;
}
#featured .info h2{
	font-size:18px; font-family:Georgia, serif;
	color:#fff; padding:2px; margin:0;
	overflow:hidden;
}
#featured .info p{
	margin:0 5px;
	font-family:Verdana; font-size:11px;
	line-height:15px; color:#f0f0f0;
}
#featured .info a{
	text-decoration:none;
	color:#fff;
}
#featured .info a:hover{
	text-decoration:underline;
}
#featured .ui-tabs-hide{
	display:none;
}
</style>
<!-- jQuery - Do you already load this javascript?  (i.e. cometchat) -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" ></script>

<!-- Rotating Code -->
<script type="text/javascript">
    $(document).ready(function(){
        $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
    });
</script>
<!-- / Rotating Code -->
<?php
global $db,$vbulletin,$sess, $std, $INFO, $vboptions, $session, $bbcode;
// vBulletin: Parse BBCode
if (!is_object($bbcode_parser)){
	require_once('./includes/class_bbcode.php');
	$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
}

$forumid				= array(4);			// Set forum IDs here.
$limit					= '5';				// Limit the displayed slides
$chars					= 130;			// Character limit for the slide text, e.g. 100 is 100 characters limit.
$words					= 25;			// Word limit for the slide text, e.g. 20 is 20 words limit
/* ------------------------------ NOTHING TO CHANGE BELOW THIS LINE ------------------------------ */


// Start loop
$forumid = implode(',',$forumid);
$getnews = $db->query_read("SELECT threadid from ".TABLE_PREFIX."thread WHERE attach !='0' AND forumid in($forumid) ORDER by sticky DESC, threadid DESC LIMIT $limit");
while ($news = $db->fetch_array($getnews)) {
	$myid[]=$news['threadid'];
}
$tabhtml="";
$contenthtml="";
$div_id = 1;

if ($myid) {
foreach ($myid as $threadid) {
$getpics = $db->query_read("SELECT t.threadid as tid, t.title as title,t.replycount as rcount, p.pagetext as pagetext,a.attachmentid as attach,f.forumid as forumid,f.title as forum from ".TABLE_PREFIX."thread as t
	LEFT JOIN ".TABLE_PREFIX."post as p on(t.firstpostid=p.postid)
	LEFT JOIN ".TABLE_PREFIX."attachment as a on(a.contentid=p.postid)
	LEFT JOIN ".TABLE_PREFIX."forum as f on(t.forumid=f.forumid)
	where t.threadid='$threadid'
	ORDER BY attach DESC
	LIMIT 1");

while ($pic = $db->fetch_array($getpics)) {
$replies=$pic['rcount'];
if ($replies=='1') {
$update="- (1 update)";
} elseif ($replies>'1') {
$update="- ($replies updates)";
} else {
$update="";
}

$pic['pagetext'] = $bbcode_parser->do_parse($pic['pagetext'],false,false,false,false,false,false);
$link = "../showthread.php?t=".$threadid."";
$imagepath = "../attachment.php?attachmentid=".$pic['attach'];
$titleContent = ucwords($pic['title']);
$introtext = $pic['pagetext'];
$pattern = '~\[([^\]]+?)(=[^\]]+?)?\](.+?)\[/\1\]~'; 
preg_replace($pattern, ' ' , $introtext); 
$OpenBrace = '\['; 
$CloseBrace = '\]'; 
$NotACloseBrace = "[^{$CloseBrace}]"; 
$Multiple = '+?'; 
$Optional = '?'; 
$Anything = "(.{$Multiple})"; 
$StartTag = "{$OpenBrace}({$NotACloseBrace}{$Multiple})(={$NotACloseBrace}{$Multiple}){$Optional}{$CloseBrace}"; 
$EndTag = "{$OpenBrace}/\\1{$CloseBrace}"; 
$FullPattern = "~{$StartTag}{$Anything}{$EndTag}~"; 
$String = $introtext;
$String = preg_replace($FullPattern, '', $String); 
$introtext = $String;

 // clean images
$introtext = preg_replace("/<img.+?>/", "", $introtext);
 // HTML cleanup
if ($striptags) {
$introtext = strip_tags($introtext, $allowed_tags);
}
// if character limitation is defined
 if ($chars) {
 if(function_exists("mb_string")) {
 $introtext = mb_substr($introtext, 0, $chars).'...';
} else {
 $introtext = substr($introtext, 0, $chars).'...';
}
}


if(function_exists("mb_string")) {
 $titleContent = mb_substr($titleContent, 0, 40).'...';
} else {
 $titleContent = substr($titleContent, 0, 40).'...';
}

// if word limitation is defined
if ($words) {
$word_arr = str_word_count($introtext, 2);
$c = 0;
foreach ($word_arr AS $k => $v) {
if ($c == $words) {
if(function_exists("mb_string")) {
$introtext = mb_substr($introtext, 0, $k).'...';
} else {
$introtext = substr($introtext, 0, $k).'...';
}
break;
}
$c++;
}
}
$introtext = unhtmlspecialchars($introtext, true);

$tabhtml .= "<li class='ui-tabs-nav-item' id='nav-fragment-".$div_id."'><a href='#fragment-".$div_id."'>";
$tabhtml .="<img src='".$imagepath."' height='35px' width='50px' alt='' />";
$tabhtml .="<span>".$titleContent." ".$update."</span></a></li>";

$centerhtml .="<div id='fragment-".$div_id."' class='ui-tabs-panel' style=''>";
$centerhtml .="<img src='".$imagepath."' width='630px' height='350px' alt=''/>";
$centerhtml .="<div class='info'>";
$centerhtml .="<br><br><br><br><br><br><br><br><b><a href='".$link."'>".$titleContent."</a> </b>";
$centerhtml .="".$introtext."</div></div>";


$div_id++;
}
}

$db->free_result($getpics);
unset($pic);
$db->free_result($getnews);
unset($news);
// End loop

$tabhtml = "<div id=\"featured\"><ul class=\"ui-tabs-nav\">".$tabhtml."</ul>";

echo $tabhtml.$centerhtml."</div>";
}
?>
Reply With Quote
  #295  
Old 08-14-2011, 12:13 PM
Budget101 Budget101 is offline
 
Join Date: Jul 2008
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have this installed in a "widget" like the directions show. However, currently all of my widgets have a "frame" with a title. I would like this to show without the "widget" style (basically to look like content without any frame at all, So it's blended.
How do I do that?
Reply With Quote
  #296  
Old 08-14-2011, 12:48 PM
victorvu victorvu is offline
 
Join Date: Mar 2011
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Cory Booth:

Thanks for the mod. I installed it according to the instructions, but got the empty shell, as shown below:

Attachment 131949

Do you have the complete code ?

Victor
Reply With Quote
  #297  
Old 08-14-2011, 05:49 PM
Wordplay Wordplay is offline
 
Join Date: Nov 2001
Location: Dengoku
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Budget101 View Post
I have this installed in a "widget" like the directions show. However, currently all of my widgets have a "frame" with a title. I would like this to show without the "widget" style (basically to look like content without any frame at all, So it's blended.
How do I do that?
just change the widget template.
Reply With Quote
  #298  
Old 08-14-2011, 06:26 PM
Budget101 Budget101 is offline
 
Join Date: Jul 2008
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wordplay View Post
just change the widget template.
thank you, I completely missed that the first time around. Got it now :-)
Reply With Quote
  #299  
Old 08-14-2011, 06:29 PM
Budget101 Budget101 is offline
 
Join Date: Jul 2008
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by victorvu View Post
Hello Cory Booth:

Thanks for the mod. I installed it according to the instructions, but got the empty shell, as shown below:

Attachment 131949

Do you have the complete code ?

Victor
Victor, the code is complete, I had the same error that you're experiencing, when you configure the widget to add it in, do not delete the existing code which is:

Code:
$output = date(vB::$vbulletin->options['dateformat']) . "<br />\n";
Instead, add the code for your slider directly after it. You should then be able to see your slider without any issue, provided everything else is installed/configured correctly.
Reply With Quote
  #300  
Old 08-14-2011, 06:36 PM
Budget101 Budget101 is offline
 
Join Date: Jul 2008
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, in setting this up I am seeing the following issue- the text description (preview text) doesn't appear in the bottom under the title of the CMS slider. (using recent_section_articles.php) Any ideas how to fix?

Thanks!
Reply With Quote
  #301  
Old 08-14-2011, 07:03 PM
Budget101 Budget101 is offline
 
Join Date: Jul 2008
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wordplay View Post
i don't mind that it's on the left anymore, it can stay there, i just want to get rid of the space between the column with the thumbs and the actual image.
Edit:

Code:
#featured ul.ui-tabs-nav li {
    color: #666666;
    font-size: 12px;
    padding: 1px 0 1px 13px;
}
change the padding line to:
padding: 1px 0 1px 0px;
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 05:40 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04937 seconds
  • Memory Usage 2,349KB
  • 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
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete