How does WP Greet Box work? - php

I have noticed some blogs using what looks like a wordpress plugin to detect if the website visitor came from google search. how is this done?
http://omninoggin.com/projects/wordpress-plugins/wp-greet-box-wordpress-plugin/

The plugin checks the $_SERVER['HTTP_REFERRER'] value (since it is written in PHP) which holds the referrer of the loaded page, then parses it to check what site the user came from to welcome them accordingly.

Related

How to achieve immediate redirect to page before home page in Magento?

I am converting a Wordpress website to Magento. One aspect of this switch is achieving a Video Intro into the website. Currently it utilizes a Wordpress plugin which loads a website http://example.com/video-intro before http://example.com and after the video is finished playing the window is redirected to http://example.com.
I have purchased the pure PHP version of this plugin (documentation here: http://plugins.themestrike.com/videointro2/documentation-php/), but it does not seem to work with Magento. I cannot figure out why. The page http://example.com/video-intro works great, the redirect works great, but I cannot get http://example.com/video-intro to come up before anything else. *The plugin creator has responded as unable to provide any support for the script.
Off the top of my head, you could do 2 things:
use a php header function to redirect the home page to the page you wish - more info: http://php.net/manual/en/function.header.php
Alter your .htaccess file to always re-direct users to the video link.
However it is worth considering what do you do when considering repeat users who have already seen the video.

Redirect my website joomla

I want to redirect my website in differents languages when detect the country by (GeoIP), actually i have these urls and works well clicking on the flag images.
www.myweb.com/en www.myweb.com/es www.myweb.com/pt
But i dont know how to do it in joomla using the geoip.
I tried with .htacess and the answer of this question
how to redirect domain according to country IP address
and i have the error 500
SOLUTION:
Joomla provides a browser settings in system language plugin, just setting the joomla with this works perfectly!!
This extension does the job: http://extensions.joomla.org/extensions/style-a-design/templating/11173 Note that it's commercial. Your alternative would be download the GeoIP database (it's available for free), and then create a small plugin that does the redirection.
If you want, you can take a look at our post here: http://www.itoctopus.com/how-to-block-a-whole-country-on-your-joomla-website on how to block a country. You will only need to slightly modify the code to make it so that it redirects to another page for a certain country.
Try this,
Create a system plugin for Joomla
PHP functions available for checking visitors country use that identify the location.
redirect according to that.
Hope it helps..

WordPress Referrer Tracking

I have a WordPress blog that's hosted within my site (http://www.mysite.com/blog) and my website itself is based on ASP.NET.
I'm tracking referrers within ASP.NET upon session start and storing them within a session variable to save into my database either after a session expires or after a visitor converts to a member.
How can I track the referrers for visitors that come to the blog first and click on a link to a page within the website? Is there a way in WordPress that I could pass the referrer using a query string?
When they land on the blog drop a cookie with the original referrer.
Then read this from the app.
Whip up a plugin to do something like this:
if( !isset($_COOKIE['ref']) ) {
setcookie(...);
}
If you feel like a hack you could just add this to WP's index.php, but a plugin would be the more portable, clean option.

Determine the current page in PHP within a wordpress plug-in

This issue has been driving me up a wall.
I've been working on a mobile website for a friend who uses wordpress. I'm attempting to modify a wordpress plugin that "rethemes" each page for mobile users. I want the plugin to do it's normal thing ("retheme" the page) iff the user is on the blog page, otherwise (if the user visits a different page, he will be redirected to a different address (the address of the mobile website).
In order to do this, I have to be able to detect whether I'm on the blog page, or a different page when the functions in the plugin are run.
I tried condtionals like is_home, is_page(id), ect., but none of them work. I also tried parsing the url and attempting to determine the page that way, but I can't.
I'm just getting my feet wet with PHP, so I'm really not sure what to try next.
To restate my question: How can I determine whether I'm on a certain page within a wordpress plugin function?
The plugin, for the record, is "Wordpress PDA & iPhoned" (http://imthi.com/wp-pda/)
Here's the relevant code:
function PDAPlugin() {
if(true) {
header("Location: http://adavidcreation.com/mobile");
exit;
}
...
}
This works, but I want to change the if statement to only be true if it's NOT the blog.
Any help would be greatly appreciated!
Try using this, which should retrieve the page id: $id = get_option('page_for_posts');
If this doesnt work -> https://wordpress.stackexchange.com/

How does mediawiki implement Special:Allpages?

We could access all pages of Mediawiki by url ./wiki/Special:Allpages.
But there is not php file that named Special:Allpages. How does mediawiki implement it?
Thanks.
For an indepth explanation see: http://www.mediawiki.org/wiki/Category:Wiki_page_URLs
However, here is a condensed version:
In Mediawiki the URL is not a link to a specific page like a simple web site. Instead it is a key that is used by the code to determine what page is displayed and to whom it is displayed.
Everything points to a single PHP page and that page directs the request to the actual page being called. So a call to SomePage may actually go to MyPage.php instead of SomePage.php
Based on how one sets up Mediawiki (or other modern PHP sites) this can be accomplished in many ways.
For Apache users one can use ModRewrite: http://www.mediawiki.org/wiki/Manual:Short_URL/Apache_Rewrite_rules
Or one can use URL Local Settings: http://www.mediawiki.org/wiki/Manual:Short_URL/LocalSettings.php

Categories