Forums / Developer / Referrer node_id

Referrer node_id

Author Message

K259

Thursday 15 January 2004 2:50:00 pm

Does anyone know how I can get the referrer $node_id?

Best regards.

Willie Seabrook

Thursday 15 January 2004 3:12:24 pm

Do you mean for example if a user is viewing content/view/full/123 and clicks a link to content/view/full/456 you want to be able get the node value 123 inside the template that displays 456?

If so, there is no such feature in ezPublish that I know of.

What you could do though is enable get parameters in your templates so that you can reference a get parameter in a template.

IE:

In the template that displays 123 you would add display the link like so:

/content/view/full/456?referrer_node_id={$node_id}

then in the template that displays 456:

{$Parameters:get.referrer_node_id}

You can enable this by editing kernel/content/view.php
and adding a couple of lines to add the request parameters as a template variable.

I can dig out the code if this is what you would like. Be warned however, doing this means you need to turn of the cache for that template, slowing down its display.

Regards,
Willie

K259

Thursday 15 January 2004 4:06:21 pm

Hi!

Tnx for your suggestion.

I don't wanna slow down the site (already have "problems" with the speed), so I think I have to solve this in another way..

Hope to find a solution during the night ;)

Willie Seabrook

Thursday 15 January 2004 5:08:30 pm

It shouldn't impact *much* on speed, you can turn cache off in a template with:

{set-block scope=root variable=cache_ttl}0{/set-block}

I think you can also turn it off for only certain parts of a template too. (Check forums)

Secondly, to increase speed within on ez you should use mmCache or Zend cache (depending on how much money you have). Zend is great cause it allows you to use the Zend debugger modules etc because they are not compatible with mmCache. http://www.ez.no/developer/ez_publish_3/documentation/configuration/optimization
for more info.

Also, ezPublish is very database intensive (many queries per page) so using slave database servers, and/or putting your database on a seperate machine is a very wise idea.

I can't imagine any other way to do what your trying to do that doesn't involve setting up new db tables and adding code to the kernel. Let me know what solution you end up using.... I'd be very interested.

Edited:

Also see http://www.ez.no/developer/ez_publish_3/forum/setup_design/3_3_0_2_cache_block_doesn_t_really_block

Regards,
Willie

K259

Friday 16 January 2004 1:00:25 am

Yup, I'll check it out later, and give you feedback on "the solution" ;)

Btw..we earlier used PHP Acc., but changed yesterday to Turck MMCache, since the development of PHP Acc. is almost "dead".

The problem is not regarding using an accelerator for php or not(of course this increases the speed), and you can't run eZ publish without an accelerator..that's also crazy :p , but eZ publish uses about 200-300 queries for -non-cached pages, and that's innsain much.. That's why the system is slow. (Our database is btw. now 750mb.)

Another problem is that the php files(which also includes other php files etc. etc.) consists of too many lines. Everything programmed with php over a 1000 lines pr. file is "not good", hehe (just a friend of mine complained about this in eZ, but i don't know..I'm not a php-guru)..and finally..mysql..hmm..

Mysql: in v. 5.0 of mysql, triggers and procedures are a new functionallity. If you've checked out MS SQL SERVER, you'll see all the possibillites which is implemented, and all the possibillites you can do in this databasesystem too increase the speed and get better performance. A lot of procedures can be done in the database, without any programming code, så Mysql is a little weak if you compare the two...but hope and think it will get better ;)

Well, back to work.