11
techdb
Re: PHP Hack to Redirect for IE6 Theme
  • 2009/9/28 1:21

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Thanks for your quick response ghia.

I tried sticking the following code pretty much everywhere inside the theme.php file. Currently it resides at the very beginning just prior to the class xos_opal_ThemeFactory.

It works to redirect XOOPS on IE6 only when the browser is refreshed. When I load IE6 and start a new session the default theme shows up. If I hit the refresh button on IE6 then it is correctly redirected to the IE6 theme with this code in place. I tried changing a few other things around but nothing seemed to work.

I imagine it must be something with the new session going to the default theme... not sure however or if this is the problem or how to change.



// IE6 string from user_agent
$ie6 = "MSIE 6.0"; // detect browser
$browser = $_SERVER['HTTP_USER_AGENT']; // yank the version from the string
$browser = substr("$browser", 25, 8); // if IE6 set the $alert
if($browser == $ie6){ $_SESSION['xoopsUserTheme'] = 'ie6theme';}



12
techdb
PHP Hack to Redirect for IE6 Theme
  • 2009/9/27 1:06

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


I am getting tired of IE6 hacks to make current theme backward compatible and would like to isolate IE6 users to an old theme.

I am looking for a XOOPS core PHP hack that will automatically redirect users to an IE6 theme if that is the browser detected. Where is the theme loaded in XOOPS? Is there an easy way to do this?

I tried sticking this in common.php but nothing happened... any ideas?

// IE6 string from user_agent
$ie6 = "MSIE 6.0"; // detect browser
$browser = $_SERVER['HTTP_USER_AGENT']; // yank the version from the string
$browser = substr("$browser", 25, 8); // if IE6 set the $alert
if($browser == $ie6){ define("XOOPS_THEME_URL", XOOPS_URL . "/ie6themes"); }



13
techdb
Re: @Trabis: Defacer
  • 2009/9/2 2:44

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Release Candidate clears up all the issues from my earlier post. So far everything working great including the theme switcher.

Will do a little more testing in near future.

Great module! Thanks so much.



14
techdb
Re: @Trabis: Defacer
  • 2009/9/1 20:15

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Trabis- I am a big fan of this module and glad you provided an update. I downloaded the rar file in this link.

I have been using your original beta on my site and it works great. XOOPS Version - XOOPS 2.3.3
PHP Version - 5.2.9
MySQL Version - 5.0.24a-standard-log
Server API Version - cgi-fcgi
OS Version - Linux

I tried to update by copying files and updating module.

I get an error:

Parse error: syntax error, unexpected ';' in /home/XXXX/XXXXX/modules/defacer/admin/admin_about.php on line 22

Also pages that use to work fine with Defacer Beta 1 give white screen when I update to Beta 2. Long story short...Looking at timers... Defacer Footer does not seem to be loading with updated code...

Header.php changes were already made for Beta 1. Pages that used to work with Beta 1 give blank screen with Beta 2. I fixed by reloading Beta 1 files...

Beta 2 Timers/Queries/Extras below:



TIMERS

XOOPS took 0.072 seconds to load.
XOOPS Boot took 0.042 seconds to load.
Module init took 0.030 seconds to load.
Defacer Header took 0.016 seconds to load.

EXTRAS

Defacer: INIT MODULE
Defacer: INIT CONFIG
Defacer: Getting config 'disable_defacer' : 0
Defacer: Getting config 'disable_permissions' : 0
Defacer: INIT permission HANDLER
Defacer: Getting handler 'permission'
Defacer: Getting config 'xoops_url' :http://www.XXXX
Defacer: INIT page HANDLER
Defacer: Getting handler 'page'
Defacer: Getting config 'disable_themes' : 0
Defacer: INIT theme HANDLER
Defacer: Getting handler 'theme'
Defacer: Getting config 'xoops_url' :http://www.XXXXX
Defacer: Getting handler 'page'
Included files: 48 files
Memory usage: 4542384 bytes

QUERIES

SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
SELECT sess_data, sess_ip FROM session WHERE sess_id = 've3jl0ua6blb34i1bpur6rqkn4'
SELECT * FROM users WHERE uid = '2'
SELECT * FROM modules WHERE dirname = 'wfdownloads'
SELECT * FROM config WHERE (conf_modid = '33') ORDER BY conf_order ASC
DELETE FROM protector_access WHERE expire < UNIX_TIMESTAMP()
SELECT COUNT(*) FROM protector_access WHERE ip='XXXXX' AND request_uri='/modules/wfdownloads/viewcat.php?cid=1'
SELECT COUNT(*) FROM protector_access WHERE ip='XXXXX'
INSERT INTO protector_access SET ip='XXXXXXX',request_uri='/modules/wfdownloads/viewcat.php?cid=1',expire=UNIX_TIMESTAMP()+'5'
SELECT * FROM modules WHERE dirname = 'defacer'
SELECT * FROM config WHERE (conf_modid = '145') ORDER BY conf_order ASC
SELECT * FROM `defacer_permission`
SELECT * FROM defacer_page, modules WHERE (page_status = '1' AND page_id IN (1)) AND (mid=page_moduleid)
SELECT * FROM `defacer_theme`
SELECT * FROM defacer_page, modules WHERE (page_status = '1') AND (mid=page_moduleid)



15
techdb
Re: @Trabis: Defacer
  • 2009/3/14 14:42

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Thanks for the advice. Checking timers let me find the problem in my header and footer files.

I am not a coder so I need to follow instructions exactly...

In the header file...I was not using the @ and just using include_once... you might want to stress that you need to paste code exactly....

Second problem I had which you might want to clarify in the readme... the footer doesn't use a defined but rather a !defined and therefore I ran into problems because I was putting your code inside the second bracket...

The following works:

if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}

@include_once XOOPS_ROOT_PATH . '/modules/defacer/include/beforefooter.php';

I really think something like this needs to be included in the core... the original XOOPS method of allowing the option of assigning the same metadata to every page represented a horrible idea for SEO because it was flagged as duplicate content by the robots.

Module seems to work very well so far.



16
techdb
Re: @Trabis: Defacer
  • 2009/3/13 17:29

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Sorry to be so vague but I use my production site for testing... Where can I look to see if module is running correctly? I check source code and the various XOOPS debug modes and don't see any evidence that beforeheader.php is being called correctly. I already tried disabling protector which didn't make a difference... could textsanitizer be knocking it out?




17
techdb
Re: @Trabis: Defacer
  • 2009/3/13 11:41

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Thanks for the work on one of the most important modules to come out in a long time. Duplicate meta content has been a very difficult issue to work with regarding SEO and although some modules (especially the D3) allow customization, most of the XOOPS modules do not. XBS Metatags was buggy with later versions of XOOPS and I have had to resort to a very basic custom coding solution.

My question… can anyone get this module to work? I am assuming it will allow me to assign custom metatags to a particular XOOPS page... I am running XOOPS Version - XOOPS 2.3.0 PHP Version - 5.2.6 MySQL Version - 5.0.24a-standard-log Server API Version - cgi-fcgi. I have made the changes in line 193 class/page.php as well as the standard changes in the header and footer files indicated in the readme files.

On the xuups forum… one of the last questions is regarding making changes in the Default theme to which you state no changes are needed… I wonder if that person was also having difficulty. I have spent a few hours trying without success and there is not enough posted about this module yet to let me know if others are using it without problems.

Now that I see a developer is on the issue I am very interested to see if I am the only one having difficulty. I appreciate your time because I believe that this module has incredible potential and want to get it running ASAP.



18
techdb
Re: Get Metadata in a block- Is it possible?
  • 2008/5/2 14:04

  • techdb

  • Just popping in

  • Posts: 23

  • Since: 2005/3/7 1


Has anyone managed to get DBCSS working correctly with 2.0.18.1?

Read Me file is not in english

I already have a bunch of GI Joe's stuff running (i.e. xoops/trust/path/ protector, altsys, etc) It installs and seems to run (no errors on debug) just fine but when I check my source on pages I get:


<link rel="stylesheet" type="text/css" media="all" href="http://www (dot)laparoscopic (dot) md/common/css/common.css" />

<link rel="stylesheet" type="text/css" media="all" href="http://www (dot) laparoscopic (dot) md/modules/dbcss/index.php?css=common.css" />


<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />

Looks like it is there but when I check the source meta name="description" the same metadata generated from XOOPS core.

Ideas?





Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.8 mod_ssl/2.8.22 OpenSSL/0.9.7e

PHP version 5.2.3
MySql version 5.0.24a-standard-log




TopTop
« 1 (2)



Login

Who's Online

250 user(s) are online (170 user(s) are browsing Support Forums)


Members: 0


Guests: 250


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits