Advertisement:

Author Topic: How to reverse-check if WAP2 is not required (SMF 1.1.x)  (Read 1437 times)

Offline paulscode

  • Newbie
  • *
  • Posts: 8
How to reverse-check if WAP2 is not required (SMF 1.1.x)
« on: September 10, 2011, 02:40:14 PM »
Hello, I am using SMF 1.1.14, and have recently been delighted to discover that my thread is listed first for the Google search "Mupen64Plus Android".  However, the link directs you to the wap2 theme (address listed ends in ";wap2").  I know that most of the people using that link do not require the wap2 version, so I'm wondering if there is a mod that I can apply that will do the opposite check that SMF normally does (i.e. check if wap2 is not required, and use the default theme instead if not).  Any ideas?

--EDIT--  If this topic fits better in the modifications section, please feel free to move it.
« Last Edit: September 20, 2011, 02:25:55 PM by AngelinaBelle »

Offline paulscode

  • Newbie
  • *
  • Posts: 8
Re: How to reverse-check if WAP2 is not required
« Reply #1 on: September 10, 2011, 04:48:30 PM »
I added a workaround by inserting the following at the top of index.php:

Code: [Select]
if( isset( $_GET['topic'] ) && $_GET['topic'] == '29.25;wap2' )
{
    header( 'Location: http://www.paulscode.com/forum/index.php?topic=29.msg129#msg129' ) ;
}

This works, but it is not desirable, since topic 29.25 is the first post of page 6 for legitimate wap2 users.  It is ok for now, because the nature of the particular topic makes it unlikely that most people would be reading it from the beginning anyway (most readers will be accessing either the first post or recent posts near the end).  That being said, I would still prefer a more elegant method of doing this.

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Re: How to reverse-check if WAP2 is not required
« Reply #2 on: September 20, 2011, 02:25:00 PM »
I'm going to move this to a custom coding board.  I hope it will attract more attention there.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor