Author Topic: [SOLVED] Please help  (Read 10436 times)

Offline greekgod

[SOLVED] Please help
« on: April 18, 2007, 08:24:23 am »
I am trying to get the `shop` button in place on my forum, I have read the coding made for other custom forums & tried some but, my shop button still doesn`t show.

I am using Tech head by Bloc for version 1.1.1

link:
http://custom.simplemachines.org/themes/index.php?lemma=12

Any suggestions greatly appreciated, cheers.

Offline CRONUS

Re: Please help
« Reply #1 on: April 18, 2007, 03:26:58 pm »
Search in index.template.php :
Code: [Select]
        // The [calendar]!
        if ($context['allow_calendar'])
                echo '<a href="', $scripturl, '?action=calendar"><img name="calendar" id="calendar"  onmouseover="javascript:document.calendar.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar_over.gif\'" onmouseout="javascript:document.calendar.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif\'" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 0px 0;" border="0" /></a>';

Add before it:
Code: [Select]
//Begin SMFShop code
//loadLanguage("shop");
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=shop">Shop</a>
</td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
//END SMFShop code

But this Bloc theme is using images for buttons so i suggest you to make images for shop and instead of above code add this one:
Code: [Select]
        // The [shop]!
        if ($context['allow_shop'])
                echo '<a href="', $scripturl, '?action=shop"><img name="shop" id="shop"  onmouseover="javascript:document.shop.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/shop_over.gif\'" onmouseout="javascript:document.shop.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/shop.gif\'" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/shop.gif" alt="Shop'" style="margin: 0px 0;" border="0" /></a>';

So you gonna need shop_over.gif and shop.gif
« Last Edit: April 18, 2007, 03:31:18 pm by CRONUS »

Offline greekgod

Re: Please help
« Reply #2 on: April 18, 2007, 04:01:51 pm »
Right thanks for that Cronus!  :)

I`l give it a go  O0

Offline greekgod

Re: Please help
« Reply #3 on: April 20, 2007, 07:55:41 am »
Got a parse error  :(

Although I hadn`t uploaded any button images but I wouldnt have thought that would cause an error :-\

Am I wrong ?

Offline CRONUS

Re: Please help
« Reply #4 on: April 20, 2007, 02:10:26 pm »
Could You paste the code? From the button before shop to the one after it?

eg.
Code: [Select]
// Don't remember :)
.....

// The [shop]!
.....

// The [calendar]!
....

Offline greekgod

Re: Please help
« Reply #5 on: April 20, 2007, 05:02:41 pm »
 // Edit Profile... [profile]
        if ($context['allow_edit_profile'])
                echo '<a href="', $scripturl, '?action=profile"><img name="profile" id="profile"  onmouseover="javascript:document.profile.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile_over.gif\'" onmouseout="javascript:document.profile.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif\'" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" style="margin: 0px 0;" border="0" /></a>';

        // The [calendar]!
        if ($context['allow_calendar'])
                echo '<a href="', $scripturl, '?action=calendar"><img name="calendar" id="calendar"  onmouseover="javascript:document.calendar.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar_over.gif\'" onmouseout="javascript:document.calendar.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif\'" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 0px 0;" border="0" /></a>';

Offline CRONUS

Re: Please help
« Reply #6 on: April 20, 2007, 05:19:49 pm »
I can't see Shop button ::)

Offline greekgod

Re: Please help
« Reply #7 on: April 20, 2007, 06:09:53 pm »
Ah right, I copied that from the index template, obviously I removed the `shop` button otherwise the forum wouldn`t work, but basicly I just pasted the one you told me to try for Bloc in between these 2 .

Offline CRONUS

Re: Please help
« Reply #8 on: April 20, 2007, 06:27:51 pm »
It should look like that:
Code: [Select]
        // Edit Profile... [profile]
        if ($context['allow_edit_profile'])
                echo '<a href="', $scripturl, '?action=profile"><img name="profile" id="profile"  onmouseover="javascript:document.profile.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile_over.gif\'" onmouseout="javascript:document.profile.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif\'" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" style="margin: 0px 0;" border="0" /></a>';

        // The [shop]!
        if ($context['allow_shop'])
                echo '<a href="', $scripturl, '?action=shop"><img name="shop" id="shop"  onmouseover="javascript:document.shop.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/shop_over.gif\'" onmouseout="javascript:document.shop.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/shop.gif\'" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/shop.gif" alt="Shop" style="margin: 0px 0;" border="0" /></a>';

        // The [calendar]!
        if ($context['allow_calendar'])
                echo '<a href="', $scripturl, '?action=calendar"><img name="calendar" id="calendar"  onmouseover="javascript:document.calendar.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar_over.gif\'" onmouseout="javascript:document.calendar.src=\'' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif\'" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 0px 0;" border="0" /></a>';

Offline Daniel15

Re: Please help
« Reply #9 on: April 20, 2007, 10:09:08 pm »
Tiny error in the code CRONUS originally posted...
Find:
Code: [Select]
'/shop.gif" alt="Shop'" style="margin: 0px 0;" border="0"
Repalce with:
Code: [Select]
'/shop.gif" alt="Shop" style="margin: 0px 0;" border="0"

Offline CRONUS

Re: Please help
« Reply #10 on: April 20, 2007, 10:30:12 pm »
oops  :-[
but in tle last reply i fixed it ;)

Offline Daniel15

Re: Please help
« Reply #11 on: April 20, 2007, 10:48:34 pm »
Don't worry, I do stupid things like that all the time :P

Offline greekgod

Re: Please help
« Reply #12 on: April 21, 2007, 01:35:42 am »
Cheers ! I will have another go tonight when the board is quiet  ;)

Offline greekgod

Re: Please help
« Reply #13 on: April 21, 2007, 07:51:27 am »
Ok I inserted that script, no errors this time, I created 2 buttons as gif files & named them accordingly, placed them in the theme/image/english directory but,    they don`t show up on the forum!  :(

The buttons don`t match the existing buttons but are the same size (height) would that make a problem?

Sorry to be a pest guys, i`m even debating switching to default theme to cure this but, as a very last resort.  :-\

Offline Daniel15

Re: Please help
« Reply #14 on: April 21, 2007, 10:47:01 am »
You sure you put them in Themes/[theme name]/images/english? What happens if you try to access the files in your web browser (if you go to http://[yourforum]/Themes/[theme name]/images/english, do they appear in the directory listing?)