News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Simple request about a marquee

Started by Pedro1234, March 15, 2011, 06:10:58 AM

Previous topic - Next topic

Sir Osis of Liver

#20

Your site was down a few minutes ago, but now it's working.  You should be able to restore the original index.template.php immediately if you have a problem (you do save a copy, I hope).  The parse error is due to the <script> code being outside the echo statement. 

Try this -


// Show a linktree (vB Clone).  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree1()
{
  global $context, $settings, $options;


// JS Scroller
echo '
<script type="text/javascript" src="ticker.js"></script>
<div id="ticker"></div>
';


  // Folder style or inline?  Inline has a smaller font.
  echo '<div class="navbar" style="font-size:10pt">';


Not the most elegant way to do it, but simple, and easy to remove if it screws up.  Works in 1.1.11, and puts the scroller where you want it.  Should be the same in 1.1.13.  The ticker.js file must be in your top SMF directory, with index.php.  You can work on the formatting once you have it running.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Pedro1234

#21
I am really concerned, none of the categories work on my site - even though i am running the 'default' them currently. This is weird considering i only touched the custom theme's index.template.php? Will try to reinstall the theme i think, because the index.template.php is back to normal but i am still having these problems...after i restore everything, i will give that code a go

i added the code to index.template.php in my administration panel on my website....this has changed somehow, but my index.template.php template on my web hosting server is fine and HAS NOT CHANGED, therefore my site should work but doesnt....do you think this is strange?

Sir Osis of Liver


If you switched from another theme to the default, it should be using a different template than the one you changed.

I'm seeing this error when I click on any forum -

Fatal error: Cannot redeclare theme_linktree() (previously declared in /home/exposedd/public_html/Small Machines/Sources/Load.php(1733) : eval()'d code:369) in /home/exposedd/public_html/Small Machines/Sources/Load.php(1733) : eval()'d code on line 399

What did you do after you got the template parse error?



Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Pedro1234

After i got the error, I deleted all of the javascript code that was within the smTema custom theme index.template.php via my website admin within the forum.....the default index.template.php remains untouched which is why i am scratching my head.....i have no idea why the default theme is bringing up this error as i didnt touch the default files at all!. I could put the index.template.php up again to see if you can see any changes that should not be there?

Thanks again :)

mashby

Always be a little kinder than necessary.
- James M. Barrie

Sir Osis of Liver

Quote from: Pedro1234 on March 22, 2011, 10:31:13 PM
After i got the error, I deleted all of the javascript code that was within the smTema custom theme index.template.php via my website admin within the forum

Yikes!    Don't know how the admin edit functions work - I edit files directly and ftp them to the server - but some files are common to all themes, and you may have inadvertently modified one.

I'm attaching your original index.template.php with the code added for the scroller.  Make sure you replace the template in the custom theme, not the default.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Quote from: mashby on March 22, 2011, 10:44:28 PM
http://www.exposeddeception.com/index.php?theme=6
That URL throws an error for sure.
http://www.exposeddeception.com/index.php?theme=1
That one is fine. I smell a conspiracy.

That may be my socks.   :P

The first link won't load at all.  The second one loads the main index page correctly, but none of the forum links work.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

mashby

Ah, OK. I see. It's your socks all right. As much as I don't really want to know about the scent of your socks, I'm likely as curious as you are as to why this is happening:
Quote/home/exposedd/public_html/Small Machines/Sources/Load.php(1733) : eval()'d code on line 399
From what I've read here, nothing should have affected that file. Might you be able to connect to your site via FTP Pedro? And/or let us know what you've done to get to this point?
Always be a little kinder than necessary.
- James M. Barrie

Sir Osis of Liver


Don't think the problem's in Load.php.  If I understand the error correctly, another file is trying to redeclare theme_linktree, after it's already been declared in Load.php. 

In the index.template.php he's been working in, it's here -


// Show a linktree (vB Clone).  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()


That's where he had the bad code, which he apparently tried to remove.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Pedro1234

Quote from: mashby on March 22, 2011, 10:57:59 PM
Ah, OK. I see. It's your socks all right. As much as I don't really want to know about the scent of your socks, I'm likely as curious as you are as to why this is happening:
Quote/home/exposedd/public_html/Small Machines/Sources/Load.php(1733) : eval()'d code on line 399
From what I've read here, nothing should have affected that file. Might you be able to connect to your site via FTP Pedro? And/or let us know what you've done to get to this point?

haha...i like you're humour....i can still connect via FTP. i usually do all my editing that way but this time stupidly did it in my forum admin! :-\   Do you think it may be an idea to try starting from scratch and re-installing the theme? would i be correct in assuming that this would not affect any of the content in the forums if i did this?
Quote from: Krash. on March 22, 2011, 11:25:56 PM

Don't think the problem's in Load.php.  If I understand the error correctly, another file is trying to redeclare theme_linktree, after it's already been declared in Load.php. 

In the index.template.php he's been working in, it's here -


// Show a linktree (vB Clone).  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()


That's where he had the bad code, which he apparently tried to remove.



This line is actually in the index.template.php twice in quick succession seperated by some code like 'return>;  or something like that....could that be the problem? When i get home i will post my current index.template.php

Sir Osis of Liver


Quote from: Pedro1234 on March 23, 2011, 12:10:53 AM
This line is actually in the index.template.php twice in quick succession seperated by some code like 'return>;  or something like that....could that be the problem?

No.  If you look at the second line, the function is theme_linktree1() - it's a different function.  If you upload the original index.template.php that I attached a couple posts above, it should fix whatever you did, unless you changed another file.  The mystery is why the default theme doesn't work if you only made changes in the custom theme. 

You should be able to reinstall and connect to the same database without losing anything, but I've never done it so I'll let someone else answer that.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Pedro1234

I have attached 2 files here, the first is the 'smtema' custom theme one, the other is the default theme one....thanks again

Pedro1234

#32
Also, just replaced my index.template in the smtema theme with the one you made for me (as i thought this may fix it) ...now everything is down, default theme not working at all now

Fatal error: Cannot redeclare theme_linktree() (previously declared in /home/exposedd/public_html/Small Machines/Sources/Load.php(1733) : eval()'d code:369) in /home/exposedd/public_html/Small Machines/Sources/Load.php(1733) : eval()'d code on line 399

I think it's best i dont touch anything  :)

PS: I dont think the thread title is any longer appropriate  ;)

Sir Osis of Liver


What's this at the top of both files?


index.template.php
PHP script text
<?php
// Version: 1.1.5; index


That's not what's on your server, is it?

Should be -


<?php
// Version: 1.1.5; index



Quote from: Pedro1234 on March 23, 2011, 04:44:16 AM
PS: I dont think the thread title is any longer appropriate  ;)

Roger that!
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Did you install an ads mod while we've been doing this?

The smtema template contains this -


echo '
        <div id="footerarea">
<span class="smalltext">', theme_copyright(), '<br /><a href="http://www.smfads.com" target="_blank">SMFAds</a> for <a href="http://www.createaforum.com" title="Forum Hosting">Free Forums</a>
<br /><b>SM-Tema-v2</b> Theme 2010 Design By <a href="http://indir-rap.blogspot.com/" target="_blank">goKhaN-c3</a></span></div><br />';


Your original template looks like this -


echo '
        <div id="footerarea">
<span class="smalltext">', theme_copyright(), '
<br /><b>SM-Tema-v2</b> Theme 2010 Design By <a href="http://indir-rap.blogspot.com/" target="_blank">goKhaN-c3</a></span></div><br />';



That's the only difference I see.  The same smfads.com link is in your default template.  It was not in your original template.





Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Pedro1234

regarding ......   index.template.php PHP script text<?php// Version: 1.1.5; index

- That is not in the code at all, it is simply the header on the page....

I installed the codes for ad management but they didnt work....i was going to delete it but just have not had time yet.

regarding this:    echo '        <div id="footerarea">   <span class="smalltext">', theme_copyright(), '   <br /><b>SM-Tema-v2</b> Theme 2010 Design By <a href="http://indir-rap.blogspot.com/" target="_blank">goKhaN-c3</a></span></div><br />';

do you recommend deleting this from the default theme? Also, i think it might be for the best for me to try and completely start over and FTP the original index.template.php from smTEMA. At least that way we would know another file is causing the problem..

Sir Osis of Liver

   If the ad management mod is the same one that's been discussed in several threads here in recent weeks, you'd probably be better off reinstalling the board from scratch than trying to fix it.  The ad mod has caused problems for more experienced users than you (or me), and apparently doesn't uninstall cleanly.  Suggest you start another thread re: reinstalling SMF without losing your database.  Once the board is up and running again, should be no problem to get the scroller set up.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Pedro1234

You may be onto it! Thanks for your help mate, hope i can return the favour eventually when my skills with SMF are up to scratch.

Would you reccomend not using the ad mod at all? I am glad i am not the only one - i got a migrane trying to make that mod work.

I will start a new thread and/or look for info on a re-install without losing the data later today


Sir Osis of Liver


I believe there's a support forum for that mod (should be at the url in the link), but others have posted that it's not much help.  If you look in SMF 1.x Support, you'll see yet another thread from a user trying to uninstall the ad mod.  If you do a search on the board, you'll come up with lots of complaints about that mod.

Get your board straightened out, get the scroller working, then worry about ads.  And don't forget to make backup copies of files before you tinker with them.

Good luck!



Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: