News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF Content Slider v.1.1

Started by Mick., July 05, 2011, 05:45:27 PM

Previous topic - Next topic

Matthew K.


Mick.


Matthew K.

You're welcome :) Hope you've been doing well?

Mick.

Quote from: Labradoodle-360 on September 15, 2011, 08:14:30 PM
You're welcome :) Hope you've been doing well?
not too bad, thanx.  You too brother.

Summer is about over, im now finding time behind the puter.  ;)

moguns

Slider works well! Thank you! Everyone likes it.

But it does get annoying because it shows up not just on the board index but all the pages and even new posts. Is there a way to only get it  to show on board index? if not is there a way to get it to show up on the registration page only?

Mick.

Quote from: moguns on September 17, 2011, 01:46:22 PM
Slider works well! Thank you! Everyone likes it.

But it does get annoying because it shows up not just on the board index but all the pages and even new posts. Is there a way to only get it  to show on board index? if not is there a way to get it to show up on the registration page only?
See reply#1 for portals.

moguns

yes thanks.. I seen that but we don't want a front page being it's all about the forum anyways. Frontpage looks cool but thats about it for what our forum is about...

First, Thank you again for sharing this mod.

Second is there a way to make it for guests only? That would be great too!

Thank you so much again for making this  mod

Mick.

Try this, i didnt test it tho.


In index.template.php find the slider clode.
//SMF Slider v.1 by: bluedevilcustoms.com
global $modSettings;
if (!empty($modSettings['slider_enabled']) && (!empty($modSettings['slider_title1']) && !empty($modSettings['slider_img1']) || !empty($modSettings['slider_title2']) && !empty($modSettings['slider_img2']) || !empty($modSettings['slider_title3']) && !empty($modSettings['slider_img3']) || !empty($modSettings['slider_title4']) && !empty($modSettings['slider_img4']) || !empty($modSettings['slider_title5']) && !empty($modSettings['slider_img5']) || !empty($modSettings['slider_title6']) && !empty($modSettings['slider_img6'])))
{
echo '<br />
<div class="center">
<div id="lofslidecontent45" class="lof-slidecontent">
<div class="preload"><div>
</div>
</div>
<!-- MAIN CONTENT -->
<div class="lof-main-wapper">
', !empty($modSettings['slider_title1']) && !empty($modSettings['slider_img1']) ? '<div class="lof-main-item"><img src="'. $modSettings['slider_img1']. '" title="'. $modSettings['slider_title1']. '" alt="'. $modSettings['slider_title1']. '" height="300" width="900"></img></div>' : '', '
', !empty($modSettings['slider_title2']) && !empty($modSettings['slider_img2']) ? '<div class="lof-main-item"><img src="'. $modSettings['slider_img2']. '" title="'. $modSettings['slider_title2']. '" alt="'. $modSettings['slider_title2']. '" height="300" width="900"></img></div>' : '', '
', !empty($modSettings['slider_title3']) && !empty($modSettings['slider_img3']) ? '<div class="lof-main-item"><img src="'. $modSettings['slider_img3']. '" title="'. $modSettings['slider_title3']. '" alt="'. $modSettings['slider_title3']. '" height="300" width="900"></img></div>' : '', '
', !empty($modSettings['slider_title4']) && !empty($modSettings['slider_img4']) ? '<div class="lof-main-item"><img src="'. $modSettings['slider_img4']. '" title="'. $modSettings['slider_title4']. '" alt="'. $modSettings['slider_title4']. '" height="300" width="900"></img></div>' : '', '
', !empty($modSettings['slider_title5']) && !empty($modSettings['slider_img5']) ? '<div class="lof-main-item"><img src="'. $modSettings['slider_img5']. '" title="'. $modSettings['slider_title5']. '" alt="'. $modSettings['slider_title5']. '" height="300" width="900"></img></div>' : '', '
', !empty($modSettings['slider_title6']) && !empty($modSettings['slider_img6']) ? '<div class="lof-main-item"><img src="'. $modSettings['slider_img6']. '" title="'. $modSettings['slider_title6']. '" alt="'. $modSettings['slider_title6']. '" height="300" width="900"></img></div>' : '', '
</div>   
<!-- END MAIN CONTENT -->
<!-- NAVIGATOR -->
<div class="lof-navigator-outer">
<ul class="lof-navigator">';
// Item One
if (!empty($modSettings['slider_title1']) && !empty($modSettings['slider_img1']))
{
echo '<li>
<div>';
echo '<img src="', $modSettings['slider_img1'], '" alt="', !empty($modSettings['slider_short_text1']) ? $modSettings['slider_short_text1'] : '*', '" />';
                echo '<h3>
', !empty($modSettings['slider_url1']) ? '<a href="'. $modSettings['slider_url1']. '" target="_self">'. $modSettings['slider_title1']. '</a>' : $modSettings['slider_title1'], '
</h3>
', !empty($modSettings['slider_short_text1']) ? '<span>'. $modSettings['slider_short_text1']. '</span>' : '', '
</div> 
</li>';
}
// Item Two
if (!empty($modSettings['slider_title2']) && !empty($modSettings['slider_img2']))
{
echo '<li>
<div>';
echo '<img src="', $modSettings['slider_img2'], '" alt="', !empty($modSettings['slider_short_text2']) ? $modSettings['slider_short_text2'] : '*', '" />';
                echo '<h3>
', !empty($modSettings['slider_url2']) ? '<a href="'. $modSettings['slider_url2']. '" target="_self">'. $modSettings['slider_title2']. '</a>' : $modSettings['slider_title2'], '
</h3>
', !empty($modSettings['slider_short_text2']) ? '<span>'. $modSettings['slider_short_text2']. '</span>' : '', '
</div> 
</li>';
}
// Item Three
if (!empty($modSettings['slider_title3']) && !empty($modSettings['slider_img3']))
{
echo '<li>
<div>';
echo '<img src="', $modSettings['slider_img3'], '" alt="', !empty($modSettings['slider_short_text3']) ? $modSettings['slider_short_text3'] : '*', '" />';
                echo '<h3>
', !empty($modSettings['slider_url3']) ? '<a href="'. $modSettings['slider_url3']. '" target="_self">'. $modSettings['slider_title3']. '</a>' : $modSettings['slider_title3'], '
</h3>
', !empty($modSettings['slider_short_text3']) ? '<span>'. $modSettings['slider_short_text3']. '</span>' : '', '
</div> 
</li>';
}
// Item Four
if (!empty($modSettings['slider_title4']) && !empty($modSettings['slider_img4']))
{
echo '<li>
<div>';
echo '<img src="', $modSettings['slider_img4'], '" alt="', !empty($modSettings['slider_short_text4']) ? $modSettings['slider_short_text4'] : '*', '" />';
                echo '<h4>
', !empty($modSettings['slider_url4']) ? '<a href="'. $modSettings['slider_url4']. '" target="_self">'. $modSettings['slider_title4']. '</a>' : $modSettings['slider_title4'], '
</h4>
', !empty($modSettings['slider_short_text4']) ? '<span>'. $modSettings['slider_short_text4']. '</span>' : '', '
</div> 
</li>';
}
// Item Five
if (!empty($modSettings['slider_title5']) && !empty($modSettings['slider_img5']))
{
echo '<li>
<div>';
echo '<img src="', $modSettings['slider_img5'], '" alt="', !empty($modSettings['slider_short_text5']) ? $modSettings['slider_short_text5'] : '*', '" />';
                echo '<h5>
', !empty($modSettings['slider_url5']) ? '<a href="'. $modSettings['slider_url5']. '" target="_self">'. $modSettings['slider_title5']. '</a>' : $modSettings['slider_title5'], '
</h5>
', !empty($modSettings['slider_short_text5']) ? '<span>'. $modSettings['slider_short_text5']. '</span>' : '', '
</div> 
</li>';
}
// Item Six
if (!empty($modSettings['slider_title6']) && !empty($modSettings['slider_img6']))
{
echo '<li>
<div>';
echo '<img src="', $modSettings['slider_img6'], '" alt="', !empty($modSettings['slider_short_text6']) ? $modSettings['slider_short_text6'] : '*', '" />';
                echo '<h6>
', !empty($modSettings['slider_url6']) ? '<a href="'. $modSettings['slider_url6']. '" target="_self">'. $modSettings['slider_title6']. '</a>' : $modSettings['slider_title6'], '
</h6>
', !empty($modSettings['slider_short_text6']) ? '<span>'. $modSettings['slider_short_text6']. '</span>' : '', '
</div> 
</li>';
}
echo '</ul>
</div>
</div>
</div>
<script type="text/javascript">
var _lofmain =  $(\'lofslidecontent45\');
var _lofscmain = _lofmain.getElement(\'.lof-main-wapper\');
var _lofnavigator = _lofmain.getElement(\'.lof-navigator-outer .lof-navigator\');
var object = new LofFlashContent( _lofscmain,
  _lofnavigator,
  _lofmain.getElement(\'.lof-navigator-outer\'),
  { fxObject:{ transition:Fx.Transitions.Quad.easeInOut,  duration:800},
interval:3000,
direction:\'opacity\' } );
object.start( true, _lofmain.getElement(\'.preload\') );
</script>';
}
//End of SMF Slider v.1



And add this just above it.
if ($context['user']['is_guest'])

moguns

Just tested and it still shows up on user's and guests. Any other ideas? 

moguns


Mick.

Mod updated. Changed the slider behaviour as it wont show everywhere else but the boardindex.  ;)

Biology Forums

I wish this were available for 1.x! Could you port it and would it be hard?

Also, what javascript did you used to write this mod?

Mick.

Quote from: shuban on September 21, 2011, 06:02:50 PM
I wish this were available for 1.x! Could you port it and would it be hard?

Also, what javascript did you used to write this mod?

It shouldnt be hard to port to 1.1.x. It just that once 2.0 RC1  came out, i never looked back.

I use google mootools.... http://ajax.googleapis.com/ajax/libs/mootools/1.11/mootools-yui-compressed.js

Biology Forums

Quote from: bluedevil on September 21, 2011, 07:00:45 PM
Quote from: shuban on September 21, 2011, 06:02:50 PM
I wish this were available for 1.x! Could you port it and would it be hard?

Also, what javascript did you used to write this mod?

It shouldnt be hard to port to 1.1.x. It just that once 2.0 RC1  came out, i never looked back.

I use google mootools.... http://ajax.googleapis.com/ajax/libs/mootools/1.11/mootools-yui-compressed.js

Thanks BlueDevil, I just never plan on changing to 2.x, well not in a long while.

Also, would you have a sample of this mod actually working (live demo?)

Mick.

Yep, I don't use it in the boardintex.php. I took the entire code bit and put it in a php block using tiny portal.
http://www.chevyavalancheclub.com/index.php

Biology Forums

Quote from: bluedevil on September 21, 2011, 08:13:44 PM
Yep, I don't use it in the boardintex.php. I took the entire code bit and put it in a php block using tiny portal.
http://www.chevyavalancheclub.com/index.php

I'm sold, I really like this. Please, someone, port it to 1.x!

moguns

Thanks BD,

But still no way to make it to where guest only?

Mick.

Moguns, this works...

Find:
//SMF Slider v.1 by: bluedevilcustoms.com
global $modSettings;


Add after:

if ($context['user']['is_logged'])

acesfool

Hi. I like this mod. I'm having one problem with it. It seems to install and when I enter the settings the objects show up where they're supposed to. But it seems to stretch out my page. Just below the slider is a very long patch of blank page before getting to the forums. In that stretch of blank page are 3 or 4 circles that appear to be trying to load something. It's hard to explain but I'm not sure if I'm allowed to link to my forum here.

kenng

If this mod can fetch topic from forum, it will work like a charm! Thanks again, you did a great job! RIght now i have to enter image, links, description manually . Hope you can update to fetch topic from forum! will save many people!

Advertisement: