SMF Shop
SMFShop => Coding => Topic started by: greekgod 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.
-
Search in index.template.php :
// 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:
//Begin SMFShop code
//loadLanguage("shop");
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </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 . '"> </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:
// 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
-
Right thanks for that Cronus! :)
I`l give it a go O0
-
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 ?
-
Could You paste the code? From the button before shop to the one after it?
eg.// Don't remember :)
.....
// The [shop]!
.....
// The [calendar]!
....
-
// 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>';
-
I can't see Shop button ::)
-
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 .
-
It should look like that:
// 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>';
-
Tiny error in the code CRONUS originally posted...
Find:
'/shop.gif" alt="Shop'" style="margin: 0px 0;" border="0"
Repalce with:
'/shop.gif" alt="Shop" style="margin: 0px 0;" border="0"
-
oops :-[
but in tle last reply i fixed it ;)
-
Don't worry, I do stupid things like that all the time :P
-
Cheers ! I will have another go tonight when the board is quiet ;)
-
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. :-\
-
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?)
-
Hi Daniel thanks for the reply,
Yes they are there through Admin on the forum :(
Should I try a test with say the `help` button which is already created & just rename it shop? see if it shows then ?
-
Tried that, still nothing ! :(
-
dumb question but have you done a hard refresh of your screen or logged out and back in, just to make sure you are picking up the changes? You probably have but it doesnt hurt to check these things out :)
-
Hi
Yes I tried that too
-
Daniel, I PM`d you
-
Ok I sorted it but, i`m confused how or why I had to leave in the if ($context['allow_calendar'])
It won`t work if I change the calendar to `shop` .see below//
Anyone any thoughts? or shall I just leave it like that ?
The [shop]!
if ($context['allow_calendar'])
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>';
-
check permissions if shop is allowed to view for members and then try
if ($context['allow_shop'])
-
Permissions where?
-
http://[your_forum]/index.php?action=permissions
P.S. If even admin can't see the button then i think that SMFShop did not install corectly ::)
-
Ok thanks Cronus ;)
Another question,
I`m trying to upload images to shop_images but I keep getting this error !
move /home/username/tmp/cpanel.TMP.EhdoxFgP29xlGFOa, /home/username/public_html/Sources/shop/item_images/101_beer.jpg failed: Permission denied
C:\Documents and Settings\richi\My Documents\My Pictures\101_beer.jpg (101_beer.jpg): upload failed
I tried changing permissions to 777 but it says access denied, yet i have no problem within my theme directory editing or uploading images i.e. shop button images.
Any ideas? :(
-
Ok I sorted it but, i`m confused how or why I had to leave in the if ($context['allow_calendar'])
It won`t work if I change the calendar to `shop` .see below//
Anyone any thoughts? or shall I just leave it like that ?
The [shop]!
if ($context['allow_calendar'])
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>';
Get rid of the "allow_calendar" line. It should just look like:
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>';
I`m trying to upload images to shop_images but I keep getting this error !
move /home/username/tmp/cpanel.TMP.EhdoxFgP29xlGFOa, /home/username/public_html/Sources/shop/item_images/101_beer.jpg failed: Permission denied
C:\Documents and Settings\richi\My Documents\My Pictures\101_beer.jpg (101_beer.jpg): upload failed
I tried changing permissions to 777 but it says access denied, yet i have no problem within my theme directory editing or uploading images i.e. shop button images.
Any ideas?
This happens on some hosts. Ask your host to chown /home/username/public_html/Sources/shop/item_images/ to your username. This should fix the issue ;)
-
Thanx Daniel, sorted all them issues now ;)