Not really any specific use really other than someone had asked in this thread about how to get at that information so I thought I would have a go at making a plugin to do just that.
People have used it for different uses such as bread-crumb trails and the like but really it does just what it says on the tin (tin is located at the top post! ).
If people find a use for it then great but I really just made it to help someone out in a post the once and thought I would place it into the plugins forum for people to use.
One plugin that I just created that you may (or may not) find useful though - depending on if you use comments on your site or not - is my new Group Comment plugin.
Sorry I can’t give more information on this plugin though as I never used it myself but rather just created it to help someone out.
Unfortunately some of your code is missing above but I think I get what you are after.
I’ve never done it using my plugin as that was just written for one single purpose but what you are after can definitely be done and might be a little easier if you use a session variable as opposed to PHP, just keeps the templates looking a little neater in my mind
There’s a very good session variables plugin available here :
You could set the session variable to the current page and then when you go to the next page you should be able to retrieve it really easily. As for using my plugin in conjunction with that one I’ve never tried it so can’t say that it would definitely work but you could always use something like this instead if it doesn’t :
and so on and so forth up until 9 segments and do it that way I guess instead. You could also write a simple plugin which would do all this for you too probably so that you would find the URI first and then write it into a session variable and then have a tag on your next page which brings back the session variable again. So basically taking my plugin and the session variables plugin and creating them as one entity.
PS: in case you’re wondering, “koko” means “here” in Japanese… I like to use Japanese for my variables, it usually takes care of potential conflicts thoroughly
No link to any new download anywhere that I can see.
I thought I had an error in the zip and was re-uploading it.
Mark Bowen - 08 March 2009 10:53 AM
B.T.W. If you have made some additions then you could have just asked me to do them first. I’m quite approachable you know
No worries. I didn’t intend to step on any toes, I was (literally) just making the change and figured since it was a Sunday morning, I’d just go ahead and post it. Didn’t expect you’d be around.
No link to any new download anywhere that I can see.
I thought I had an error in the zip and was re-uploading it.
Ah okay I see now
Aaron Gustafson - 08 March 2009 10:58 AM
Mark Bowen - 08 March 2009 10:53 AM
B.T.W. If you have made some additions then you could have just asked me to do them first. I’m quite approachable you know
No worries. I didn’t intend to step on any toes, I was (literally) just making the change and figured since it was a Sunday morning, I’d just go ahead and post it. Didn’t expect you’d be around.
As some might know in here I’m always around, an all seeing user me!!
Aaron Gustafson - 08 March 2009 10:58 AM
Feel free to adjust what I’ve done as you see fit
I’m sure what you have done is fine but will check it out a little later on.
I want the full url returned, then I plan to just add a ‘,tag’ to allow rapid adjustments of the search query that Solspace Tags are doing. But the plugin actually returns a modified url:
Note that its stripped the index.php from the url (which is required because otherwise my .htaccess code throws a Disallowed characters error), and it adds a closing / which I don’t want, because I want the url exactly as it displays in the URL box, not cleaned up.
The additional functions seem great, but applying them on the default and without control seems to defeat the purpose of the plugin, at least for us who just need an easy way to grab, the exact url of the current page. Is there anyway to turn these modifications off. My current usage looks like:
When you say the modifications then do you mean with the plugin that Aaron posted above? If so then you can still download the original plugin from my first post if you wish.
No, I’m just using version 1.02 of the original plugin. I also tried version 1.00. I believe the problem maybe that the plugin is pulling the details from EE itself and not the $_SERVER . I don’t know. But the fact that I’m stripping out the index.php everywhere else in EE and the addition of the / is reflected in the url, at the base level. I even went into PHP and just added the line
Ah I see what you mean now. You are indeed right that the plugin creates the URL using built-in ExpressionEngine code methods. I didn’t want to use server variables as I wasn’t too well versed with them when I wrote the plugin so just went with the built-in functions instead.
Saying that though you can very easily create a current URL by doing something like this though :
I’m definitely not a hardcore coder by any means, but it turns out i’m pretty good at modyfing! I compared this plug-in to an EE2.0 plug-in and attempted to make some tweaks to make it work with EE2.0.. and much to my surprise it worked!
I’m not sure if i’m allowed to post the altered file / whether you plan to do it yourself Mark?