PEAK XOOPS - xoops redirect hack in englishin japanese

xoops redirect hack

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2007/10/24 1:11 | Last modified
sugar  ÆóÅùʼ From: Taiwan  Posts: 6
reference
http://xoops.peak.ne.jp/md/news/index.php?page=article&storyid=70

xoops cube 2.0.16a

STEP1.
Edit include/functions.php find
        $xoopsTpl->assign('lang_ifnotreload', sprintf(_IFNOTRELOAD, $url));
        $GLOBALS['xoopsModuleUpdate'] = 1;
add below
		// GIJ start
		if( ! headers_sent() ) {
			$_SESSION['redirect_message'] = $message ;
			$_SESSION['redirect_time'] = $time * 1000 ;
			header( "Location: ".preg_replace("/[&]amp;/i",'&',$url) ) ;
			exit ;
		}
		// GIJ end 

STEP2.
Edit use theme/theme.html add start
<{php}>
	if( ! empty( $_SESSION['redirect_message'] ) ) {
		$this->_tpl_vars['xoops_msg'] = $_SESSION['redirect_message']; 
		$this->_tpl_vars['wait_time'] = $_SESSION['redirect_time']; 
		unset( $_SESSION['redirect_message'] ) ;
	}
<{/php}>


STEP3.
Edit theme.html add before </head> tag
<script type="text/javascript">
function init( ) {
	// .... other command
	Tag = document.getElementById("divLoading");
	Tag.style.display = "none";
}
window.setTimeout(init, <{$wait_time|default:1000}>); //default loadding 1 second
</script>
<style type="text/css" media="all">
#divLoading {
	position:absolute;
	left:50%;
	top:50%;
	z-order=0;
	z-index=100;
	width: 300px;
	margin-left: -150px;
	height: 100px;
	margin-top: -50px;
	filter:alpha(opacity=90);
	-moz-opacity: 0.9;
	opacity: 0.9;
	border:1px #FF8811 solid;
	background-color:#FFEFC9;
	color:#CC6600;
	text-align:center;
	vertical-align:middle;
}
#divLoading p {
	vertical-align:middle;
	padding:20px;
}
#divLoading p img {
	vertical-align:middle;
	padding:5px;
}
</style>

STEP4.
Edit theme.html add below <body> tag
<{if $xoops_msg}>
<div id="divLoading">
  <p><img src="<{$xoops_imageurl}>images/loadingAnimation.gif" /><br /><{$xoops_msg}></p>
</div>
<{/if}>

STEP5.
upload loadingAnimation.gif to images directory

demo like http://xoops.tnc.edu.tw/uploads/newbb/48_46e9fced3acbf.jpg
Votes:172 Average:8.08
Previous post - Next post | Parent - No child | Posted on 2007/10/24 3:51
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi sugar.
It looks great!

One point.
Quote:

		// GIJ start
		if( ! headers_sent() ) {
			$_SESSION['redirect_message'] = $message ;
			$_SESSION['redirect_time'] = $time * 1000 ;
			header( "Location: ".preg_replace("/[&]amp;/i",'&',$url) ) ;
			exit ;
		}
		// GIJ end 
Votes:71 Average:6.34

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!