TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 651
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 139
  • Total: 139

TP and Modifications?

Started by Ephemeral, February 25, 2007, 07:05:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ephemeral

I am currently using bloc's oxygen tp template, it can be viewed here: http://philosophy-forums.com

I had a few mods installed, namely an RSS feed mod that added the RSS icon after each board name.

For some reason, this mod stopped working, and I'm not sure why. I think it worked with TP and the default theme, but as soon as I changed to the oxygen theme the icons dissapeared.

If anyone knows how to fix this your help would be appreciated.

rebelrose

Mods all install to the default theme, you have to modify custom themes for them to work with it.

Ephemeral

Quote from: Ã,©RebelRose on February 25, 2007, 07:08:15 AM
Mods all install to the default theme, you have to modify custom themes for them to work with it.

What? Are you sure? Because some of the other mods I had installed before are working with oxygen, just not a select few.

How would I go about modifying the custom theme to make it work?

rebelrose

Some theme designers add the code for certain mods to there theme so if you install that mod it will work with not effert on your part.

If you look at the files in the mod you will see a xml file that shows the changes that have to be made to your theme, if it shows changes to a template that is not in your theme, then you don't have to worry about that template because it uses the default theme for whatever template the theme does not have.

Ephemeral

#4
Quote from: Ã,©RebelRose on February 25, 2007, 07:14:05 AM
Some theme designers add the code for certain mods to there theme so if you install that mod it will work with not effert on your part.

If you look at the files in the mod you will see a xml file that shows the changes that have to be made to your theme, if it shows changes to a template that is not in your theme, then you don't have to worry about that template because it uses the default theme for whatever template the theme does not have.

Okay, I found the xml file and it says:

<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>vbgamer45:FeedIcon</id>
<version>1.1</version>


<file name="$themedir/BoardIndex.template.php">
<operation>
<search position="before"><![CDATA[', $board['name'], '</a></b>]]></search>
<add><![CDATA[&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" /></a>]]></add>

</operation>
</file>
<file name="$themedir/MessageIndex.template.php">
<operation>
<search position="before"><![CDATA[', $board['name'], '</a></b>]]></search>
<add><![CDATA[&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" /></a>]]></add>

</operation>
</file>

</modification>



Which template do I insert this into and where? I know, I am a total noob. I'm sorry, just computer-stupid.

rebelrose

Your not stupid, you just have not learned yet.

Look at that file and you will see where it calls for certain templates, for example, if your theme has a Boardindex.template.php, you would open it and find


[CDATA[', $board['name'], '[/url]]]


Then add this before it


![CDATA[&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" />[/url]]]


You would do that for each template in your theme, MAKE SURE TO BACKUP your files before doing this.

The above code is an example, look at the xml and find the code it is saying to search for, and what do to with it, it tells you to replace, or add before or after, then you just following the directions.

I hope this helps, please make a copy of your templates before you try to do this.




Ephemeral

Quote from: Ã,©RebelRose on February 25, 2007, 08:19:49 AM
Your not stupid, you just have not learned yet.

Look at that file and you will see where it calls for certain templates, for example, if your theme has a Boardindex.template.php, you would open it and find


[CDATA[', $board['name'], '[/url]]]


Then add this before it


![CDATA[&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" />[/url]]]


You would do that for each template in your theme, MAKE SURE TO BACKUP your files before doing this.

The above code is an example, look at the xml and find the code it is saying to search for, and what do to with it, it tells you to replace, or add before or after, then you just following the directions.

I hope this helps, please make a copy of your templates before you try to do this.





Thanks for the explanation, and I figured out how to read the xml document like you said and find where to input the code.

The only problem is I can't for the life of me find:


[CDATA[', $board['name'], '[/url]]]


in Boardindex.template.php.

It's probably there, just can't find it.



rebelrose

Try searching for a smaller part, like $board['name'], and see if you can find it that way.

G6Cad

Leave the [CDATA[ as it's only used by the XML to wrap what code to search for.

Si if the XML reads like this

[CDATA[&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" /></a>]]></add>

You leave out the [CDATA[ and ]]></add> as they are only used by the XML file so it knows what to search and add where in the code.

So the actuall string you copy and search for manually will be

&nbsp;<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" /></a>

This website is proudly hosted on Crocweb Cloud Website Hosting.