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

YOU ARE HERE:
Hooks

HOME

CPSHOP|

|

|

EMAIL MARTY
  marty.net message board
  « Hooks »
Welcome, Guest. Please Login or Register.
12/15/17 at 15:48:57
Home Help Search Login Register
   marty.net message board
   About cpshop
   Tutorials
   Hooks
(Moderator: Marty)
Pages: 1 Reply Notify of replies Send the topic Print 
   Author  Topic: Hooks  (Read 1226 times)
TomanKaren
White Dragon
**

Posts: 13




   

Hooks
« on: 01/16/12 at 16:42:47 »
Reply with quote Modify message

First thank you for taking the time to read this and secondly the time to help out an old man who just don't get it.

Could someone please post a step by step of how to use hooks. Such as:

Where in the admin exactly the hook is entered in. The exact block. My understanding is add it as a store id but that does not work or make sense. Also the store id block has another one under it that appears to be for again..store id's which makes it even more confusing.

Secondly after creating the directory "cphooks" what permissions are to be set? None of these are covered. The instructions just says to create your hooks...create your directory...a good explanation of naming the example hooks text file is given but there is no list of actual hooks that work with CP.

I thank you very much for your assistance in helping out.
Logged
TomanKaren
White Dragon
**

Posts: 13




   

Re: Hooks
« Reply #1 on: 01/16/12 at 16:47:48 »
Reply with quote Modify message

Example of my dilemma.

Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Hooks
« Reply #2 on: 01/16/12 at 17:44:39 »
Reply with quote Modify message

Hooks don't go in cpadmin, the only thing you need to do there is turn on the processing of them. At the top of cpadmin click the "other options" link and scroll down that section to "Process Hooks?" and mark "process hooks in template and code". That's it for cpadmin.

If I recall your cphooks directory should be chmod to 755, I'd have to look to see for sure.

Other than that you create your hook files and put them in your cphooks directory, and you put the actual hook(s) in your template where you want to hook to fall.

That's a brief rundown, the entire hook thing can be pretty complex and may take reading the Hooks instructions many times, and probably several more questions here.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Hooks
« Reply #3 on: 01/16/12 at 17:52:04 »
Reply with quote Modify message

Fyi, the 7 types of hooks available are listed under "hook target types & hierarchy" in the Hooks instructions. Which type of hook are you trying to use for starters?
Logged
TomanKaren
White Dragon
**

Posts: 13




   

Re: Hooks
« Reply #4 on: 01/16/12 at 17:55:16 »
Reply with quote Modify message

Thank you very much  

I will give your advise a try.
Logged
TomanKaren
White Dragon
**

Posts: 13




   

Re: Hooks
« Reply #5 on: 01/16/12 at 18:52:10 »
Reply with quote Modify message

I got nothing here.

Here is what I have tried.

1. Create hook: banner

2.  Create file: cpshop.cgi.pno.7316274.banner.txt

3: Add hook in page file: hook here      <[hook:banner]>

4: NOTE: added "hook here" to locate on page if hook was indeed placed and it shows "hook here" and no further text indicting the hook is indeed in place however the file is not generated where the hook is.

5: Contents of hook file: <a href="http://www.mysite.com/store/index.cgi/18446744070550070857/mystoreid/7316274">
<img border="0" src="http://www.mysite.com/store/images/maternity.jpg" width="185" height="402"></a>


I got nothing and I tried changing the file name to the other various options in the instructions.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Hooks
« Reply #6 on: 01/16/12 at 19:23:30 »
Reply with quote Modify message

The filename looks right and the hook looks right for the filename, is your cphooks directory in the same directory as the rest of your cpshop files? And did you check the permissions for cphooks?

Did you turn on hook processing in cpadmin?

Did you clear the cache??

If you don't want to post a link you can email me one so I can look at your page.
« Last Edit: 01/16/12 at 19:26:26 by brattytees » Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Hooks
« Reply #7 on: 01/16/12 at 19:29:01 »
Reply with quote Modify message

Never mind my last post for the moment, I think this is your problem. Looking at your hook file, did you rename cpshop.cgi in your install to index.cgi?

If you did you have to name it like that in your hook file name also:

cpshop.cgi.pno.7316274.banner.txt

should then be

index.cgi.pno.7316274.banner.txt
« Last Edit: 01/16/12 at 19:35:01 by brattytees » Logged
TomanKaren
White Dragon
**

Posts: 13




   

Re: Hooks
« Reply #8 on: 01/16/12 at 19:37:28 »
Reply with quote Modify message

The store site is www.tomankaren.com/store

Do I need to change the directory name from cphooks to indexhooks?
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Hooks
« Reply #9 on: 01/16/12 at 19:43:32 »
Reply with quote Modify message

No, cphooks needs to be just that, but you need to change the name of your hook file like in my previous post.
Logged
TomanKaren
White Dragon
**

Posts: 13




   

Re: Hooks
« Reply #10 on: 01/16/12 at 19:44:02 »
Reply with quote Modify message

That worked! You are the man! Thank you. Now to try and figure out how all the hooks work.  
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Hooks
« Reply #11 on: 01/16/12 at 19:53:12 »
Reply with quote Modify message

I was just going to post, it looks like it's working on that page...you do have a broken image under the one you just inserted though and above the FB image.
Logged
TomanKaren
White Dragon
**

Posts: 13




   

Re: Hooks
« Reply #12 on: 01/16/12 at 20:01:51 »
Reply with quote Modify message

I may have been messing with it when you looked and it appeared broke. I think they are all working now.
Logged
TomanKaren
White Dragon
**

Posts: 13




   

Re: Hooks
« Reply #13 on: 01/16/12 at 20:30:15 »
Reply with quote Modify message

Went through all of that for nothing. Dang it! It is filters I need to learn. I can basically add anything I need without a hook. Well shoot. Back to the drawing board but I do appreciate all the help.
Logged
brattytees
Gold Dragon
****

Posts: 439



ack!
   

Re: Hooks
« Reply #14 on: 01/16/12 at 20:49:34 »
Reply with quote Modify message

Lol, you didn't learn it for nothing. Everything has a use and there might come a time when it will come in handy for you. Besides, learning something that might not apply now sometimes helps with something else totally unrelated, like file naming conventions. Anyway, glad I could help.
« Last Edit: 01/16/12 at 20:51:20 by brattytees » Logged
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.