marty.net 1001 Postcards Love Love Love Meep Meep ZenZodiac DailyQuotation

YOU ARE HERE:
php in hooks?

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « php in hooks? »
Welcome, Guest. Please Login or Register.
12/13/17 at 19:02:03
Home Help Search Login Register
   marty.net message board
   About cpshop
   Customization Help
   php in hooks?
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: php in hooks?  (Read 1747 times)
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
php in hooks?
« on: 12/14/06 at 16:22:23 »
Reply with quote Modify message

I was evidently mistaken about tags not working in hooks. Hopefully I'm as mistaken about processing php in them, but I haven't been able to get php inlcudes to work.

(php includes would be quite useful for simplifying cross-sell hooks eg: "You might also like:", see www.criticalgraphics.com/peace_signs/criticalgraphic/1163304 at the bottom)

Cheers,

Patrick.
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: php in hooks?
« Reply #1 on: 12/14/06 at 16:29:04 »
Reply with quote Modify message

cpshop doesn't process php, so you can't put php in a hook.

You can, however, put hooks in your php, if you're feeding cpshop a URL as a template.  So you can have your php page print out a hook, and then cpshop will process it.  I'm just not sure if that's what you're looking for.
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: php in hooks?
« Reply #2 on: 12/14/06 at 16:50:41 »
Reply with quote Modify message

Thanks, Marty. That will be useful for other things I imagine, but what I was trying to do was turn this


Code:
<a href="/peace_signs/criticalgraphic/1163045"><img src="/resource/PeaceHeartLink.png" alt="Peace Heart :: The Heart is a Peace Sign" height=77 width=77 border=0 hspace=5 vspace=5></a>


into something more like this


Code:
<? include 'links/PeaceHeartLink.php' ?>


Then I could just splat all the gobbledygook for each design into individual php files with easily remembered names, making the cross-sell hook files much easier to manage. Right now they look like


Code:
<div style="margin-left:20px; width:480px;"><img src="/resource/YouMightAlsoLike.png" border="0"></div>
<div style="margin-left:20px; width:468px; border: 1px solid #7F7FA7; padding:5px;">
<a href="/peace_signs/criticalgraphic/1163045"><img src="/resource/PeaceHeartLink.png" alt="Peace Heart :: The Heart is a Peace Sign" height=77 width=77 border=0 hspace=5 vspace=5></a>
<a href="/peace_signs/criticalgraphic/1163263"><img src="/resource/LovePeaceButtonLink.png" alt="Love Peace: A peace symbol forms the 'O' in 'Love'" height=77 width=77 border=0 hspace=5 vspace=5></a>
<a href="/spirited_symbols/criticalgraphic/1207149"><img src="/resource/EvolveLoveLink.png" alt="Evolve Love: Cupid hearts form the 'V's in 'Evolve'" height=77 width=77 border=0 hspace=5 vspace=5></a>
<a href="/spirited_symbols/criticalgraphic/1381432"><img src="/resource/PeaceMomLink.png" alt="Peace Mom: Cupid Heart, Peace Sign and a Flower decorate the word, 'Mom'." height=77 width=77 border=0 hspace=5 vspace=5></a>
</div><br clear=all>


which makes initialising and -- to a lesser extent -- maintaining them repetitively confusing drudgery.

Not that I'm complaining -- hooks made cross-selling possible, something I've been eagerly awaiting.

cheers,

p.
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Marty
Administrator Dragon
*****

Gender: male
Posts: a whole lot



That's me. :)
   

WWW E-Mail
Re: php in hooks?
« Reply #3 on: 12/14/06 at 16:56:17 »
Reply with quote Modify message

Though it might not be a perfect solution, have you considered playing with either iframes or external javascript source files, rendered in php?  You might find a way to solve your problem.

For example -- and I'm just making this up while I type -- you might use hooks to print out certain javascript variables, and then reference them in a call to an external javascript file.  In this case, the "external javascript file" would actually be a php page printing out javascript containing your cross sell information.

It wouldn't help (nor hurt) SEO at all, but it could potentially make managing your cross-selling efforts considerably simpler.
Logged

--
Regards,
Marty·.¸¸.·´¯`·.¸¸.-> marty@marty.net
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: php in hooks?
« Reply #4 on: 12/14/06 at 23:12:44 »
Reply with quote Modify message

Yeah, IFRAME was next on my list to consider. I think I can pretty much replicate php-in-hooks behaviour as above that way. I'd lose SEO from the img ALT tags, and the 'increased spiderability' but probably a worthy trade-off given the mental gymnastics I've been doing for the first twelve or so designs, that I arleady have to update since I've added new designs.

I use java here and there for special purposes but continue to avoid it for navigational functions since 1 in 10 visitors just plain have it disabled.

Thanks,

p.
Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Hex Angel - Patrick
Gold Dragon
****

Posts: 500



Our nature lies in movement; complete calm is death.
   

WWW
Re: php in hooks?
« Reply #5 on: 12/15/06 at 07:46:16 »
Reply with quote Modify message

An IFRAME solution looks something like this...

file in cphooks dir: shop.cgi.sno.1163045.cross_sell.txt

Code:
<div style="margin-left:20px; width:480px;"><img src="/resource/YouMightAlsoLike.png" width=480 height=21 border="0" alt="You Might Also Like products featuring these designs" ></div>
<div style="margin-left:20px; width:468px; border: 1px solid #7F7FA7; padding:5px;">
<IFRAME SRC="/crosslinks/IHeartPeaceLink.txt" width=90 height=90 align=left scrolling=no frameborder=0></IFRAME>
<IFRAME SRC="/crosslinks/LovePeaceLink.txt" width=90 height=90 align=left scrolling=no frameborder=0></IFRAME>
<IFRAME SRC="/crosslinks/EvolveLoveLink.txt" width=90 height=90 align=left scrolling=no frameborder=0></IFRAME>
<IFRAME SRC="/crosslinks/PeaceMomLink.txt" width=90 height=90 align=left scrolling=no frameborder=0></IFRAME>
<br clear=left>
</div>


and a sample crosslink file to create the thumbnails: IHeartPeaceLink.txt

Code:
<a target="_top"  href="/peace_signs/criticalgraphic/1162989"><img src="/resource/IHeartPeaceLink.png" alt="I Love Peace: I Heart Peace :: The Heart is a Peace Sign" height=77 width=77 border=0 hspace=5 vspace=5></a>


Note: target="_top" is essential to break out of the IFRAME

[EDIT: I no longer use IFRAME to accomplish cross-sells on any of my sites. Instead, I place cpdig (http://www.criticalgraphics.com/cpdig) <|getfile|>tags in my hooks and then use cpdig to expand the tags.]

cheers,

p.
« Last Edit: 09/16/07 at 06:06:08 by Hex Angel - Patrick » Logged

CPSHOP
www.PeaceAndLoveShop.com Namaste
BLOG
www.TheNomadicSpirit.com Inspired by travel
www.GodBeautyPerfectionLove.com Inspired by spirit
www.MyMuseMoviesMusicAndBooks.com Inspired by the arts
Pages: 1 Reply Notify of replies Send the topic Print 
Jump to:


marty.net message board (http://www.marty.net/cgi/marty/board/messageboard)

Powered by YaBB 1 Gold - Release (Yet Another Bulletin Board)
Copyright © 2000-2001, X-Null. All Rights Reserved.