Hi guys. I'm trying to replace my logo with the thread title in the show_thread template.
So what I did was create a new template and named it "show_thread_header".
I pasted the contents of the header template into the new one, removed the logo link and the image, and replaced them with...
{$thread['threadprefix']}{$thread['subject']}
Now how do I use this new header template in the show_thread template? And am I even on the right track at all lol?
Thanks in advance.
You can do a replacement with
Template Conditionals. Replace
{$header} with the following within the
showthread template.
<?=str_replace($theme['logo'], $thread['threadprefix'].$thread['subject'], $header)?>
Oh that will replace the image not the img tag, but you get the idea.
So I downloaded the plugin and put it in my plugins folder, but it's not showing up in my admin cp. I'm using 1.8.4 on a local host. Any suggestions?
I also tried going into my global.php file and adding
eval('$show_thread_header = "'.$templates->get('show_thread_header').'";');
after
eval('$header = "'.$templates->get('header').'";');
then replacing
{$header}
with
{$show_thread_header}
in my show_thread template, but still no luck.
I don't know really. The plugin works for me. You are probably uploading in the wrong directory.
Also note that the show_thread doesn't exists in a default install, you are probably confusing it with showthread.
You could also use xThreads to use template prefixes for your forums, so creating foo_header will replace the header template for those forums which template prefix is foo_. But if you are having issues installing Template Conditionals this one will probably be harder to get.
Okay so my new header template is working. The problem is that {$thread['subject']} doesn't work outside of the showthread template.
How do I make it a global function so that I can use it in my new header?
Go the Template Conditionals way. Get it working.
(2015-03-14, 07:04 PM)OmarĀ G. Wrote: [ -> ]Go the Template Conditionals way. Get it working.
Okay so I got the plugin working. I had to convert the 7z file into a zip then extract the php file from there and install it.
So I tried the code you gave me and all it did was remove the header completely. I didn't get an error though, so I'm assuming the plugin is working.
In showthread template replace {$header} with:
<?=str_replace($theme['logo'], 'FUAHAHAHAHA!', $header)?>