i was wondering if there was any way to redirect to a certain theme.
i have a piece of code that, when put in the top if index.php it detects a mobile browser, and redirects to a specific URL. i have a somewhat mobile friendly theme on my site, and was wondering if this or a similar script could be used to change the theme automatically upon mobile browser detection.
heres the code that i have that redirects on mobile browser detection.
Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
Posted:
Sat Dec 12, 2009 9:32 am
Nice one wHiTeHaT.
Just one thing that I am going to start "evangelizing" as much as possible is moving away from
Only registered users can see links on this board! Get registered or login to the forums!
. The POSIX API is deprecated as of PHP5.3 and is discouraged against. Instead, we should be moving towards the PCRE family of functions, in this case,
Only registered users can see links on this board! Get registered or login to the forums!
.
We have our work cut our for us in RavenNuke(tm) to replace these functions.
thanks a lot for you help whitehat. but im not sure if its working... i have yet to test it on a device that has yet to visit my site.
but i cleared history and cache on both my mobile browsers, and it just shows the default theme.
if you guys care to check it out :
Only registered users can see links on this board! Get registered or login to the forums!
should i leave the $ThemeSel = get_theme(); under the code you gave me?
im going to assume that the preg_match function wouldnt work with the current version of RN. ?
i have tested it on one of my own site's and it worked.
However keep in mind the current wap devices use the common browser functions , so not all portable devices sending the mobile identification.
Goodluck
Last edited by wHiTeHaT on Mon Dec 14, 2009 3:54 pm; edited 2 times in total
i have edited the code above couse i left some test variables in it
just remove the $mytest1 instances and you are good.
There's 1 in the global line and one in the middle of the function.
But i wanted to tell you there excist a module called wap2go , it seems like the dev is starting to make it rn compatible.
you can check it here:
Only registered users can see links on this board! Get registered or login to the forums!
well, i believe that did the trick sir. thats awesome, thanks a lot for the help and the prompt feedback. this was very helpful to my site.
i actually have the wap2go installed on my site. but it doesnt work. apparently some things in the 2.3 RN config file didnt match up with the latest release of wap2go which was released in dec 2007. and he is a very busy guy and doesnt give much feedback either. ive tried all kinds of stuff and all i get is this error, "Unable to locate the RavenNuke(tm) configuration file - INCLUDE_PATHrnconfig.php " when trying to access the module.
To define the rnconfig.php file, open mobile/includes/w2g_mainfile.php and paste
Code:
if(!defined('INCLUDE_PATH')) define('INCLUDE_PATH', '../../');
under
Code:
@include("settings.php");
so it will look like this
Code:
<?php
/******************************************************************************/
/* Wap-2-Go Mobile Phone Nuke-Addon */
/* bringing the Advanced Content Management System to Mobile Format */
/* ==========================================================================*/
/* powered by Nuke Database */
/* */
/* Copyright (c) 2007 by Philip Marsh -
Only registered users can see links on this board! Get registered or login to the forums!
*/
/* */
/* FILE DETAILS and EXPLANATION: */
/* w2g_mainfile.php - Specific Functions for Mobile Site */
/******************************************************************************/
@include("settings.php");
if(!defined('INCLUDE_PATH')) define('INCLUDE_PATH', '../../');
This way if the CMS is not RavenNuke(tm), it will still work.
i put this in like you said. and it gave me another error
Unable to locate the RavenNuke(tm) configuration file - ../../rnconfig.php
**edit** i changed ('INCLUDE_PATH', '../../') to ('INCLUDE_PATH', '../') ( only one '../' and it works. outstanding. thanks a lot nuken. now i get to start moding this mod with a fancy theme and layout and such.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum