We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

question about a entry referrer extenstion I'm building

Development and Programming

avroo's avatar
avroo
164 posts
16 years ago
avroo's avatar avroo

So what I want is to log the last 5 referrers per single entry (and showing them later on the single entry page)… so I started building….but I have some questions!

I am using some existing code for getting the referrers from the Functions class (log_referrer).

Buttttt I only want to log the referer for single entries, so I don’t want to call the function/hook when I am displaying more entries and limit is not 1.

What’s the best way to do this? I think it’s best to use the weblog_entries_tagdata_end hook, and check if a second segment exists (url title).

Anyone can confirm this or tell me a better way to do it?

thanks!

       
silenz's avatar
silenz
1,648 posts
16 years ago
silenz's avatar silenz

Personally, I think a module would be a better suited solution for this type of functionality.

Create a method that does the logging. Place the tag into the {exp:weblog:entries}-pair of your single-entry-template passing the {entry_id} as a parameter.

And another method to display the results.

If you intend to put the display-tag into all (and only) your single-entry-pages, you could even combine the logging and displaying into one single method.

       
avroo's avatar
avroo
164 posts
16 years ago
avroo's avatar avroo

Sounds good, I am on it. Thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.