Zen Cart Logo
Forums / All Other Contributions/Addons / Problem with Zen Bookmarking Widget v1.0.0

Problem with Zen Bookmarking Widget v1.0.0

Views: 1,993

Results 1 to 8 of 8
24 Mar 2011, 12:36 PM
#1
zubenubi avatar

zubenubi

New Zenner

Join Date:
Jan 2010
Location:
Ireland
Posts:
88
Plugin Contributions:
0

Problem with Zen Bookmarking Widget v1.0.0

Hi there,

I'm trying to use the above module on my site. There doesn't seem to be a support thread for it so apologies for asking for help here.

For anyone who's not familiar with it this mod is meant to add all the social bookmarking icons to your product info page. It only requires creating a css file with the likes of:

.zen-bookmarking a.delicious {
background-position:0px 0px;
}
.zen-bookmarking a.delicious:hover {
background-position:0px -43px;
}
.zen-bookmarking a.digg {
background-position:0px -86px;
}
.zen-bookmarking a.digg:hover {
background-position:0px -129px;
}

and to edit your tpl_product_info_display.php with the likes of:

<!--DIGG-->
<a class='digg' href="http://digg.com/submit?phase=2&url=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>" rel='external nofollow' target='_blank' title='Digg this :>'/>

in them.

Thing is, I only want to have the icons for facebook, twitter and yahoo. So I tried re-ording the code in tpl_product_info_display.php to get the ones I want first (which worked fine) and then deleted the rest that I didn't want (which didn't work fine). That caused the icons to appear in the right order but instead of stopping at yahoo, other icons still sort of appear mixed in with and hiding behind the other elements of my page.

So I deleted the css commands for those social icons but that made no difference at all.

Where am I going wrong?!?

cheers ;)

24 Mar 2011, 1:15 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Problem with Zen Bookmarking Widget v1.0.0

I'm not familiar with that mod, but from what you've posted, I suspect that the problem is linked to how you have changed the code.

The HTML that you posted opens a self-closing link, which is rather unusual. As the css is set up for use with a single image for all the icons, it's possible that the link isn't being closed properly, which lead to all the other icons being displayed, instead of being chopped off as they would be were it properly closed.

On an unrelated point, not a good idea to put "(int)" before the cPath value as that's a string and will often not work properly if converted to an integer. There is a fallback within the Zen Cart code for if cPath can't be properly resolved, which is probably why the problem isn't obvious.

24 Mar 2011, 2:04 PM
#3
zubenubi avatar

zubenubi

New Zenner

Join Date:
Jan 2010
Location:
Ireland
Posts:
88
Plugin Contributions:
0

Re: Problem with Zen Bookmarking Widget v1.0.0

Hi thanks for the reply. I've tried adding bits of the html code from the bottom (the bits I cut off) back in but that doesn't work. If I post the whole thing would you mind pointing out the bit that closes the link?

<!--Zen Bookmarking Widget (HTML)-->
<div class='zen-bookmarking'>
<br/><font color='#289728' face='ms sans serif' size='3'><b>Share it:</b></font>
<br/><br/>
<!-- Delicious -->
<a class='delicious' href="http://del.icio.us/post?url=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&title=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Add this to Delicious :>'/>

<!--DIGG-->
<a class='digg' href="http://digg.com/submit?phase=2&url=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>" rel='external nofollow' target='_blank' title='Digg this :>'/>

<!--Stumble-->
<a class='stumbleupon' href="http://www.stumbleupon.com/submit?url=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&title=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Stumble this :>'/>

<!-- Technorati -->
<a class='technorati' href="http://technorati.com/faves?add=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>" rel='external nofollow' target='_blank' title='Fave this :>'/>

<!-- Twitter -->
<a class='twitter' href="http://twitthis.com/twit?url=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&title=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Tweet this :>'/>

<!--Facebook-->
<a class='facebook' href="http://www.facebook.com/sharer.php?u=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&t=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Share this on Facebook :>'/>

<!-- Reddit -->
<a class='reddit' href="http://reddit.com/submit?url=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&title=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Bookmark and tag this :>'/>

<!-- Yahoo -->
<a class='yahoo' href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&title=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Bookmark this :>'/>

<a class='rss' expr:href='data:blog.homepageUrl + "feeds/posts/default"'/>
</div>

<!--eof Zen Bookmark Widget-->
24 Mar 2011, 2:05 PM
#4
zubenubi avatar

zubenubi

New Zenner

Join Date:
Jan 2010
Location:
Ireland
Posts:
88
Plugin Contributions:
0

Re: Problem with Zen Bookmarking Widget v1.0.0

In case it's important here's the css:```
/--------Zen Bookmarking Widget (CSS)------/
.zen-bookmarking a {
display:block;
height:42px;
width:48px;
padding:0 9px;
float:left;
background:transparent url(http://4.bp.##########################/_7wsQzULWIwo/SxYPky2M4VI/AAAAAAAACcs/SGTHHyAiZ4A/s1600/flapper.jpg) no-repeat;
}
.zen-bookmarking a.delicious {
background-position:0px 0px;
}
.zen-bookmarking a.delicious:hover {
background-position:0px -43px;
}
.zen-bookmarking a.digg {
background-position:0px -86px;
}
.zen-bookmarking a.digg:hover {
background-position:0px -129px;
}
.zen-bookmarking a.stumbleupon {
background-position:0px -344px;
}
.zen-bookmarking a.stumbleupon:hover {
background-position:0px -387px;
}
.zen-bookmarking a.technorati {
background-position:0px -430px;
}
.zen-bookmarking a.technorati:hover {
background-position:0px -473px;
}
.zen-bookmarking a.twitter {
background-position:0px -516px;
}
.zen-bookmarking a.twitter:hover {
background-position:0px -559px;
}
.zen-bookmarking a.facebook {
background-position:0px -172px;
}
.zen-bookmarking a.facebook:hover {
background-position:0px -215px;
}
.zen-bookmarking a.reddit {
background-position:0px -258px;
}
.zen-bookmarking a.reddit:hover {
background-position:0px -301px;
}
.zen-bookmarking a.yahoo {
background-position:0px -602px;
}
.zen-bookmarking a.yahoo:hover {
background-position:0px -645px;
}
.zen-bookmarking a.rss {
background-position:0px -774px;
}
.zen-bookmarking a.rss:hover {
background-position:0px -817px;
}

24 Mar 2011, 2:16 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Problem with Zen Bookmarking Widget v1.0.0

The "/" immediately for the ">" closes it, and according to some W3 standards can be applied to all tags.

However, you page needs to be being rendered according to a standard that supports this (defined in each pages doctype statement) and in a browser that works properly with it. If the browser doesn't recognise it or the doctype is wrong, the closure may not be recognised and the background image with the icons will overflow the space intended.

However, that's a hypothesis only, and could be wrong, since without having seen your site and the problem in action, I have only the partial information provided above to go on/.

24 Mar 2011, 5:17 PM
#6
zubenubi avatar

zubenubi

New Zenner

Join Date:
Jan 2010
Location:
Ireland
Posts:
88
Plugin Contributions:
0

Re: Problem with Zen Bookmarking Widget v1.0.0

Hi I really appreciate you helping with this. I'm sorry I can't give you a link to it coz it's on my localhost and I don't want to mess up my proper site until I've got it working locally.

I know it's not the same as a url but here's a screen shot of what's happening.

24 Mar 2011, 5:37 PM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Problem with Zen Bookmarking Widget v1.0.0

I can see enough there to think that my hypothesis is unlikely to explain the problem. But not enough to know what's going on. Unfortunately this is one those problems that it difficult to be sorted without seeing it in a live environment to see precisely how the html and css are interacting, and whether anything else is getting in the way.

24 Mar 2011, 6:30 PM
#8
zubenubi avatar

zubenubi

New Zenner

Join Date:
Jan 2010
Location:
Ireland
Posts:
88
Plugin Contributions:
0

Re: Problem with Zen Bookmarking Widget v1.0.0

I understand. Thanks for having a look anyway.

If it makes a difference here's what I ended up with in my file, maybe theres something stupid I'm missing

<!--Zen Bookmarking Widget (HTML)-->
<div class='zen-bookmarking'>
<br/><font color='#289728' face='ms sans serif' size='3'><b>Share it:</b></font>
<br/><br/>
<!--Facebook-->
<a class='facebook' href="http://www.facebook.com/sharer.php?u=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&t=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Share this on Facebook :>'/>
<!-- Twitter -->
<a class='twitter' href="http://twitthis.com/twit?url=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&title=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Tweet this :>'/>
<!-- Yahoo -->
<a class='yahoo' href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&title=<?php echo $products_name; ?>" rel='external nofollow' target='_blank' title='Bookmark this :>'/>
<a class='rss' expr:href='data:blog.homepageUrl + "feeds/posts/default"'/>
</div>
<!--eof Zen Bookmark Widget-->

and css

/*--------Zen Bookmarking Widget (CSS)------*/
.zen-bookmarking a {
display:block;
height:42px;
width:48px;
padding:0 9px;
float:left;
background:transparent url(http://4.bp.##########################/_7wsQzULWIwo/SxYPky2M4VI/AAAAAAAACcs/SGTHHyAiZ4A/s1600/flapper.jpg) no-repeat;
}
.zen-bookmarking a.twitter {
background-position:0px -516px;
}
.zen-bookmarking a.twitter:hover {
background-position:0px -559px;
}
.zen-bookmarking a.facebook {
background-position:0px -172px;
}
.zen-bookmarking a.facebook:hover {
background-position:0px -215px;
}
.zen-bookmarking a.yahoo {
background-position:0px -602px;
}
.zen-bookmarking a.yahoo:hover {
background-position:0px -645px;
}