TinyPortal

Development => Block Codes => Topic started by: rockskullz on November 16, 2007, 07:41:07 PM

Title: Featured Content Slider Block
Post by: rockskullz on November 16, 2007, 07:41:07 PM
Ok, im pretty new to TP and SMF but with some playing around I have implemented this handy little snippet into my website. It works great and has no flaws that im aware of. I got the script from www.dynamicdrive.com. Its called the 'Featured Content Slider'. (link: http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm) I have edited my css file to work with my theme so dont expect it to look exactly like mine.

DEMO - http://offroad-review.com (http://offroad-review.com)

Step 1. Download 3 files from http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm (sorry couldnt attach them.
Step 2. Create 2 script blocks. 1 for each code below. (make sure both are visible to guest)
Step 3. Adjust and edit css file to match your profile, etc.

Insert this code into a center or frontpage block. You can add or remove content by adding or deleting this code below in the first file.

<div class="contentdiv">

Insert text or html here

</div>



Insert this code into a center or frontpage script block

<div class="contentslide" id="slider1">
<div class="opacitylayer">
<div class="contentdiv">

<table cellspacing="1" cellpadding="1" width="400" summary="" border="0">
   
Insert text or html here

</div>
<div class="contentdiv">

Insert text or html here

</div>
<div class="contentdiv">

Insert text or html here

</div>
<div class="contentdiv">

Insert text or html here

</div>
<div class="contentdiv">

Insert text or html here

</div>
<div class="contentdiv">

Insert text or html here

</div>

</div>
</div>
<div class="pagination" id="paginate-slider1"></div>
<script type="text/javascript">
//Define: ContentSlider("slider_ID", [autorotate_miliseconds], [custompaginatelinkstext], [customnextlinktext])

ContentSlider("slider1", 3000)
//OR ContentSlider("slider1", 3000, linktextarray)
//OR ContentSlider("slider1", 3000, linktextarray, "Foward")
//OR ContentSlider("slider1", "", linktextarray)
//OR ContentSlider("slider1", "", "", "Foward")
</script>


Insert this code into a center or frontpage script block

Important!! Edit the URL's for your file locations on this block
<link href="http://yourwebsite.com/contentslider.css" type="text/css" rel="stylesheet" /><script type="text/javascript" src="http://yourwebsite.com/contentslider.js">

/***********************************************
* Featured Content Slider- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>


Title: Re: Featured Content Slider Block
Post by: rockskullz on November 19, 2007, 08:57:09 PM
34 views and nobody appreciates my hard work...  O0 j/k
Title: Re: Featured Content Slider Block
Post by: bluedevil on November 19, 2007, 09:58:59 PM
Easy fella. Some of us work the weekends.


Yeah...ive seen the script before and been wanting to tackle this.  It looks really good in your site using the srticle system.  I like it.

Im giving this a shot.
Title: Re: Featured Content Slider Block
Post by: Craven on November 24, 2007, 04:27:01 AM
Here are the files needed
Title: Re: Featured Content Slider Block
Post by: noxe on November 24, 2007, 09:29:09 PM
Great work, will be testing this out when I get home!
Title: Re: Featured Content Slider Block
Post by: rockskullz on November 28, 2007, 11:22:50 PM
Quote from: Craven on November 24, 2007, 04:27:01 AM
Here are the files needed

thanks for posting the files.
Title: Re: Featured Content Slider Block
Post by: delvec on March 13, 2008, 06:50:34 AM
I love this script but for some reason Im messing it up
Help please?
First Im downloading the 3 files (css, js gif) and am I supposed to upload them to my root?
OK now I think this is where Im messing up-
QuoteStep 2. Create 2 script blocks. 1 for each code below. (make sure both are visible to guest)
Do you mean the css & js or the 2 below- because theres three below So should I have 5 blocks total?


Or does the first code
<div class="contentdiv">
Insert text or html here
</div>

just give you a spot to to holder content that you can move in and out of the final block?

Please help make sense of this?

Thnx
Title: Re: Featured Content Slider Block
Post by: lmoody1967 on March 27, 2008, 07:25:47 PM
Has anyone else had any luck getting this script to work ?  Not sure what I'm doing wrong, but no matter what I've tried I just can not get it to work.  Looks like a great script and would love to get this working on my site. 
Title: Re: Featured Content Slider Block
Post by: IchBin on March 27, 2008, 07:35:45 PM
Perhaps you could show us what is wrong, or even tell us whats happening? "Not working" doesn't describe much.
Title: Re: Featured Content Slider Block
Post by: lmoody1967 on March 27, 2008, 11:21:43 PM
Sorry, I realized that I didn't give much information after I posted and was hoping to edit that message before someone caught me...  I usually have pretty good luck getting these to work, but I'm really struggling on this one and I'm sure it's just something stupid on my end.  Would greatly appreciate any help in getting this to work.

I've uploaded the 3 files to my sites root directory, created 3 script center blocks and pasted the code per the instructions.   When I go to view it on my site, keep in mind I haven't edited any of the text yet, I see the following:

Block 1:  Just the text "Insert text or html here"

Block 2:  Juse see an empty blue box.

Block 3:  Doesn't show up on my site.

None of my front page articles show.

My site is:  http://www.suicide-squeeze.net
Title: Re: Featured Content Slider Block
Post by: IchBin on March 28, 2008, 01:24:54 PM
Did you change the URL's to match the path to your files in the 3 code box?
Title: Re: Featured Content Slider Block
Post by: delvec on March 28, 2008, 01:32:32 PM
IchBin,
can't speak for lmoody, but I did change the urls and got the same he was showing. Thats I wanted clarification I was doing it right.
Title: Re: Featured Content Slider Block
Post by: lmoody1967 on March 28, 2008, 05:57:01 PM
IchBin, I changed the URL's to match the path to my files, but got the same results.  I ended up finding another code from the same site in the original post that did what I wanted.  Was able to get that running with no issues.
Title: Re: Featured Content Slider Block
Post by: Smoky on March 28, 2008, 08:41:07 PM
can you point to the other code that you used?? might help someone else that might be trying this.. thanks!!  :D
Title: Re: Featured Content Slider Block
Post by: delvec on March 28, 2008, 09:46:48 PM
 yeah help a brother out
Title: Re: Featured Content Slider Block
Post by: lmoody1967 on March 29, 2008, 12:17:50 AM
I used the script from this link: 

http://www.dynamicdrive.com/dynamicindex17/featuredcontentglider.htm

Basically just created a blank web page, pasted the code into the heading and body as mentioned in the instructions, and then copied the web code to an html block on my site.  Adjusted the URL's and comments and it was off and running.  Seems to be working great.
Title: Re: Featured Content Slider Block
Post by: delvec on March 29, 2008, 02:03:26 AM
OK but wheres the webcode?
Title: Re: Featured Content Slider Block
Post by: delvec on March 29, 2008, 04:44:47 AM
Do I just put the Head script on the blank page then for the body, the take the first part of the code and then code as the block?

so blank page should be this-
<html>
<head>
<script type="text/javascript" src="jquery-1.2.2.pack.js"></script>

<link rel="stylesheet" type="text/css" href="featuredcontentglider.css" />

<script type="text/javascript" src="featuredcontentglider.js">

/***********************************************
* Featured Content Glider script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>
</head><body>
</body>
</html>


and

my block should be this....
<div class="glidecontent">
Glide content 1 here
</div>

<div class="glidecontent">
Glide content 2 here
</div>

<div class="glidecontent">
Glide content 3 here
</div>

</div>

<div id="p-select" class="glidecontenttoggler">
<a href="#" class="prev">Prev</a>
<a href="#" class="toc">Page 1</a> <a href="#" class="toc">Page 2</a> <a href="#" class="toc">Page 3</a>
<a href="#" class="next">Next</a>
</div>

and of course
featuredcontentglider.css
jquery-1.2.2.pack.js
featuredcontentglider.js
goes in the root- right?
Title: Re: Featured Content Slider Block
Post by: lmoody1967 on April 03, 2008, 02:26:22 AM
I just downloaded the 3 files from the link above, uploaded them to my root directory and then created a scriptbox and pasted the code below in the body:

<html>

<head>
<script type="text/javascript" src="jquery-1.2.2.pack.js"></script>

<link rel="stylesheet" type="text/css" href="featuredcontentglider.css" />

<script type="text/javascript" src="featuredcontentglider.js">

/***********************************************
* Featured Content Glider script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>
</head>

<body>
<script type="text/javascript">

featuredcontentglider.init({
   gliderid: "canadaprovinces", //ID of main glider container
   contentclass: "glidecontent", //Shared CSS class name of each glider content
   togglerid: "p-select", //ID of toggler container
   remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
   selected: 0, //Default selected content index (0=1st)
   persiststate: false, //Remember last content shown within browser session (true/false)?
   speed: 500, //Glide animation duration (in milliseconds)
   direction: "downup", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
   autorotate: true, //Auto rotate contents (true/false)?
   autorotateconfig: [9000, 0] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
})

</script>

<div id="canadaprovinces" class="glidecontentwrapper">

<div class="glidecontent">
<img src="http://i11.tinypic.com/8efzmmf.jpg" style="float: left; padding: 5px" />
British Columbia is the westernmost of Canada's provinces and is famed for its natural beauty. It's capital is Victoria, located at the southeastern tip of Vancouver Island. BC's most populous city is Vancouver, located in southwest corner of the BC mainland called the Lower Mainland.
</div>

<div class="glidecontent">
<img src="http://i15.tinypic.com/72vilba.jpg" style="float: right; padding: 5px"/>
Ontario is a province located in the central part of Canada, the largest by population and second largest, after Quebec in total area. Toronto, the capital of Ontario, is the centre of Canada's financial services and banking industry.
</div>

<div class="glidecontent">
<img src="http://i17.tinypic.com/8bg0lkx.jpg" style="float: left; padding: 5px"/>
Yukon, still commonly referred to as "The Yukon Territory", is the westernmost of Canada's three northern territories. The Yukon's major appeal is its nearly pristine nature. Tourism relies heavily on this and there are many organised outfitters and guides available to hunters and anglers and nature lovers of all sorts.
</div>

</div>

<div id="p-select" class="glidecontenttoggler">
<a href="#" class="prev">Prev</a>
<a href="#" class="toc">Page 1</a> <a href="#" class="toc">Page 2</a> <a href="#" class="toc">Page 3</a>
<a href="#" class="next">Next</a>
</div>
</body>

</html>