News:

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

Main Menu

Logo Rotator 0.1 Beta 1

Started by DoctorMalboro, December 12, 2010, 06:00:21 PM

Previous topic - Next topic

DoctorMalboro

Link to Mod

Logo Rotator

Created by DoctorMalboro.




Function:
It allows you to rotate the logo of your forum in default (curve) theme and it's variations.




How to make it work?
Go to Admin - Configuration - Modification Settings - Miscellaneous and check the Enable Logo Rotator option. Then, start filling the Logo Images option with the images (it can be external and internal images, example: myforum/forum/images/logo1.jpg or ubuntu.com/forum/images/logo1.jpg). Save the options and see the image rotator working ;)




FAQ


  • What size should the images have?
    It would be appropriate to be the same as the default SMF (curve) theme. My idea of an appropriate size would be 256x34. It depends on the theme you use.
  • How many images can i put?
    I recommend using your own host for your images, but if it's a free one, use some external host (ex. tinypic, imgur, photobucket, etc.)
  • I don't see any changes... why is that?
  • It doesn't seem to work in my theme... What can i do?
    Try using The Manual Installation of Mods.
  • It's impossible to adapt it... Why? :(
    I'm not a magician... if you can't adapt it, just post the name of the theme and the url of this. I will try to adapt it, but i won't promise you anything.
    If the theme is premium, ask support in the site or person you bought it from ;)




Thanks

  • Lucas-Ruroken: For helping me with some minor things ::)




Demo

Click Here

Bugo

#1
I think that you should replace this line (in modification.xml):
$txt['logo_img'] = 'Logo Images.<br /><div style="smalltext">Please, separate images with a coma (,).</div>';
with:
$txt['logo_img'] = 'Logo Images.<div class="smalltext">Please, separate images with a coma (,).</div>';

And... in package-info.xml, this line:
<modification reverse="true">install.xml</modification>
with:
<modification reverse="true">modification.xml</modification>

DoctorMalboro

Quote from: Bugo on December 16, 2010, 07:17:56 AM
I think that you should replace this line (in modification.xml):
$txt['logo_img'] = 'Logo Images.<br /><div style="smalltext">Please, separate images with a coma (,).</div>';
with:
$txt['logo_img'] = 'Logo Images.<div class="smalltext">Please, separate images with a coma (,).</div>';

And... in package-info.xml, this line:
<modification reverse="true">install.xml</modification>
with:
<modification reverse="true">modification.xml</modification>
Wow... didn't notice about the uninstall... thanks. About the other line, it's simply because i think it needs a little bit more of space, so i put a break.

lucas-ruroken

Adk Portal 3.1 is coming....

Design your universe!

Deezel

Hi there... and great mod.
I have been trying to get this to work with a theme that I helped Trax put together called Redemption.

I'm not a whiz at the coding thing just do a lot of copy and pasting..... can sometimes figure stuff out. ::)

anyways the manual installation asks to find in the index.template.php
<div id="top_section">
<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';


But it is not there.
This is the closest area I can find to where that line may have been at one point. Correct me if I'm wrong ( as noted earlier...not a whiz).
function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '
<div id="header">
  <div id="head-l">
<div id="head-r">
  <div id="userarea" class="smalltext">';
if ($context['user']['is_logged'])
{
if (!empty($context['user']['avatar']))
  echo '
<div id="my-avatar" class="clearfix">', $context['user']['avatar']['image'], '</div>';
echo '
<ul class="reset">
<li><b>', $txt['hello_member'], ' ', $context['user']['name'], '</b></li>';
  echo '
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
  <li>', $context['current_time'],'</li>
</ul>';
}


anyhoo, if anyone can shed some light on this that'd be great.

Cheers

DoctorMalboro

Attach the whole index.template.php file so i can check it...

Deezel


DoctorMalboro

Try with this one i'll attach you. The size of the images you'll have to figure out by yourself, it varies in every theme...

Crazytoones

<div id="top_section">
<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';


I can't find this. :(



busterone

Quote from: Berkan_Isg on March 19, 2011, 12:27:14 PM
<div id="top_section">
<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';


I can't find this. :(
What theme is your attached file from? It states it is 2.0RC3, but I just compared it to an RC3 default index.template.php, and it isn't default.

Crazytoones

Dzinerstudio > Express (2.0 RC5)


C4G-TK

Very sweet little mod.  Works great!

-img removed-

Deezel

Quote from: DoctorMalboro on February 27, 2011, 02:36:31 PM
Try with this one i'll attach you. The size of the images you'll have to figure out by yourself, it varies in every theme...
Hey Doc, thanks for this.... i forgot all about it and completely missed it while checking replies to my posts.

Topman

Not working in 2.0.10.
Tried to install and it said not compatible with this version of SMF!
Pity.

Shambles

It installs fine on 2.0.10, providing you emulate to 2.0 RC5

In my case I had to tweak one line in index.template.php, but otherwise it's good to go.

Topman

What is "emulate to 2.0 RC5"?

What one line of code did you change to make it work in 2.0.10.

A "Change this"

"to this"

In index.template.php  would be helpful.

Shambles

Quote
What is "emulate to 2.0 RC5"?

You've been around long enough to have read up on things like this... :P

http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version

Any reported failure to install will be accompanied by an indication of what caused it, implicitly suggesting the solution (including file edits you may need to make).

Topman

Quote from: Shambles on June 30, 2015, 03:55:50 AM
Quote
What is "emulate to 2.0 RC5"?

You've been around long enough to have read up on things like this... :P

http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version

Any reported failure to install will be accompanied by an indication of what caused it, implicitly suggesting the solution (including file edits you may need to make).

OK done that, looks like it is installed on emulate 2.0 RC5
When I re set the emulate to 2.0.10 the LogoRotator Mod on "Browse packages"  doesnt indicate either instal/uninstal in the column but it does have a green dot!

If I leave the emulate as 2.0 RC5 it appears to work on the home (/index.php) page (but only the Home page) , when I switch back rest to latest version of SMF it doesn't work and only my original main banner is on the home page.

I have edited the index.css file fro full width banner as on this thread.
http://www.simplemachines.org/community/index.php?topic=523994.msg3709468#msg3709468

The Parse for 2.0.10 says:
"Sorry, but this modification does not appear to be compatible with the selected version."

Yes I have been around a long time but I am still learning this and its getting harder!
Any ideas?

Topman

QuoteIn my case I had to tweak one line in index.template.php, but otherwise it's good to go.

What line did you tweak? and what did you change Shambles?

Shambles

Quote from: topman on July 02, 2015, 03:58:20 AM
QuoteIn my case I had to tweak one line in index.template.php, but otherwise it's good to go.

What line did you tweak? and what did you change Shambles?

Some text to allow the package installer to find what it was looking for. If you get an error during the installation the package manager will show you what it was looking for in that file... same as during any other mod install.

Topman

It installed using the emulator. Set for 2.0 RC5.
Read my yesterday post.
No errors were shown on installation.


Topman

Does anyone know what I need to do?
Is anyone going to help me with this?
I am at a loss!

Shambles

What's the problem? Did you enable it and enter some image links in the control panel?

Topman

The answer is yes!
From my earlier post:
Quote"OK done that, looks like it is installed on emulate 2.0 RC5
When I re set the emulate to 2.0.10 the LogoRotator Mod on "Browse packages"  doesnt indicate either instal/uninstal in the column but it does have a green dot!If I leave the emulate as 2.0 RC5 it appears to work on the home (/index.php) page (but only the Home page) , when I switch emulate back reset to latest version of SMF the Logo Mod doesn't work and only my original main banner is on the home page.

I have edited the index.css file for full width banner as on this thread.
http://www.simplemachines.org/community/index.php?topic=523994.msg3709468#msg3709468

The Parse for 2.0.10 says:
"Sorry, but this modification does not appear to be compatible with the selected version."
Yes I have been around a long time but I am still learning this and its getting harder!
Any ideas?

Topman

I would really like to be able to use this Mod on my forum.
If it could work it would do exactly what I want it to do.
I have a random banner picture on my wrodpress blog and it is great.

Previous posts imply it works on 2.0.10 but it doesn't.
It won't even tell you where to change the errors and what to change it too.
And the Mod designer is nowhere!

Topman

Can someone please help me with this or is it a lost cause?
Good idea for a Mod pity it doesn't work on the latest 2.0.10

Kindred

Changing the emulation after a mod is installed will have absolutely ZERO effect on the mod's behavior...   the emulation is purely in the Package Manager to allow mods for other versions to bypass the version/lock...
(and yes, once you revert to the installed version, the uninstall link will disappear...  that does not mean anything regarding the ACTUAL installation status of the mod)

So
1- the mod installed with no errors in any files?
2- the mod was applied to ALL THEMES?

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Topman

I did not apply the Mod to all themes.
I only use the Default theme with css edits to change colours.
It installs with no errors notified.

Shambles

Can you confirm the mod made file changes to {themedir}/index.template.php  and Sources/ManageSettings.php, and that you enabled the option and provided at least one image?

Topman

#29
I have just checked the index.template.php in themes dircetory.  I have attached it to this post.
I have found this:
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;

   echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '
   <div id="header"><div class="frame">
      <div id="top_section">';
  // We activate this and put the images...
if(!empty($modSettings['enable_logo_rotator']) && !empty($modSettings['logo_img']))
Quote{

$image_random = explode(',',$modSettings['logo_img']);
$randomize = rand(0,count($image_random) -1);

$logo_final = $image_random[$randomize];

//now, show me the magic!
echo' <h1 class="forumtitle">
<a href="', $scripturl, '"><img src="'.$logo_final.'" alt="' . $context['forum_name'] . '" /></a>
</h1>';
} else {
// no magic? oh, ok...
echo' <h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';
}

// the upshrink image, right-floated

So its looks like it is there>

Yes there are six images all with a comma in between as:-
plots.jpg,banner4.jpg,bnr1.jpg,bnr2.jpg,bnr3.jpg,bnr4.jpg,

By enable to option I assume you mean:
Modifications Settings > Miscellaneous >
Enable Logo rotator.   Tick in the box.
Logo Images. > Please, separate images with a coma (,).

The images displayed are on the Home page only, no where else.
Have a look I will leave it switched on for a hour or so.

Shambles

Quote from: topman
Yes there are six images all with a comma in between as:-
plots.jpg,banner4.jpg,bnr1.jpg,bnr2.jpg,bnr3.jpg,bnr4.jpg,
Where are those images hosted?

Sounds like you've placed them in your forum root folder.


Quote from: DoctorMalboro on December 12, 2010, 06:00:21 PM
[/list]

Topman

EUREKA!
Thanks shambles.

For everyone else this is what I needed to do.
http://forum.brand-newhomes.co.uk/plots.jpg,http://forum.brand-newhomes.co.uk/banner4.jpg,http://forum.brand-newhomes.co.uk/bnr1.jpg,http://forum.brand-newhomes.co.uk/bnr2.jpg,http://forum.brand-newhomes.co.uk/bnr3.jpg,http://forum.brand-newhomes.co.uk/bnr4.jpg,

add the full URL of where the images are, in my case the forum route.

Shambles

Quote from: topman
EUREKA!

Hmmm... that exclamation usually means you've suddenly solved a problem by yourself, lol :P

Glad you got it sorted.


Topman

Hi Shambles we all know it was YOU that found it not me!

Check it out!  I've got seven images up now.
takes time to size and title but definitely better than before with just one.
Not sure if page is taking longer to load now though.

Topman

Me again!
I was having a problem with no picture being displayed, I thought just on some pages.
Then I thought that the image file I listed was not on my sever.
Then after checking they all were, I noticed that I had a "," after the last image reference.
This made it think there was another image file but there wasn't.
I deleted it and now it all works peachy!

From
URL/plots.jpg,URL/banner4.jpg,URL/bnr1.jpg,URL/bnr2.jpg,URL/bnr3.jpg,URL/bnr4.jpg,
to this:
URL/plots.jpg,URL/banner4.jpg,URL/bnr1.jpg,URL/bnr2.jpg,URL/bnr3.jpg,URL/bnr4.jpg

Hope this helps others with this great Mod.

mysimplesite

Tried Emulator set to 2.0 to install in 2.0.14. Got error message saying mod not compatible with this SMF version.

Looks like a great mod and perfect for what I wanted to do. Anyone able to get this mod working on 2.014 please let me know how.

Shambles

Quote
Tried Emulator set to 2.0 to install in 2.0.14.

Try setting it to "2.0 RC5"  (without the quotes)

https://www.simplemachines.org/community/index.php?topic=412969.msg3822061#msg3822061

SeaChaser

I had a member create about 520 logos showing different pictures with each logo. I change the logo on occassion but I like the thought of using the logo rotator. All of theses images are in one on the main gallery directories (http://www.arimaowners.com/index.php?action=gallery;cat=8). Is there a way to use this mod to rotate the images in this gallery directory?

Advertisement: