MOD: Delay-category

Do you have suggestions how to improve myLounge Redirection? Want to give a feedback? Or even found a bug? Then please post in here.

Moderator: Scooby

MOD: Delay-category

Postby Ternet » Thu Sep 15, 2005 11:34 am

howdy ho!!

I needed desperately delay-category as well. SO I made few changes to the script :D

I have tested it in my testing site, so use it with your own risk. Don't blame me if it destroys your DB...

I know it is a bit looney way to do it, because the actual delay-html-page is hardcoded to index.php. It's not template. I tried to make it template-based like everything else, but could not find any appropriate solution. So if you are interested, please go ahead and improve this :D

Cheers, Terhi

Here are modification instructions.



Add category

Files to edit:
language-files
html\standard\admin\catadd1.html
myred\admin.php
index.php
--------------------------------
*** FILE: to each language-file you use:
FIND (should be the very last line of the file)

?>

BEFORE ADD:
$text_406 = "Delay";

---------------------------------
*** FILE: \html\standard\admin\catadd1.html

FIND:

<option value="adfree" selected>{text_391}</option>

AFTER ADD:
<option value="delay" selected>{text_406}</option>

It should look like this after the change

<select name="con_advtype">
<option value="popup">{text_380}</option>
<option value="upperframe">{text_381}</option>
<option value="lowerframe">{text_382}</option>
<option value="adfree" selected>{text_391}</option>
<option value="delay" selected>{text_406}</option>
</select>
----------------------------------
*** FILE: admin.php

ADD to each part listed below (ie. after line
$template->assign("text_390", $text_390); or eqvivalent):

$template->assign("text_406", $text_406);


##################################
#### The category deletion part 2 ####
##################################

##################################
#### The category deletion screen ####
##################################

##################################
#### The category edit itself ####
##################################

##################################
#### The categories addtition screen ####
##################################


ADDITONALLY:

FIND


$advtype_listbox .= ">$text_391</option>";

from
##################################
#### The categories edit screen ####
##################################

REPLACE IT:

$advtype_listbox .= ">$text_391</option>
<option value=\"delay\"";
if ($cat[advtype] == "delay") {
$advtype_listbox .= " selected";
}
$advtype_listbox .= ">$text_406</option>";


FIND EVERY OCCURANCE (should be two occurances):

!$con_adurl && $con_advtype!="adfree"

REPLACE IT WITH:

!$con_adurl && $con_advtype!="adfree" && $con_advtype!="delay"


FIND EVERY OCCURANCE (should be two occurances):

!is_numeric($con_height) && $con_advtype!="adfree"

REPLACE IT WITH:

!is_numeric($con_height) && $con_advtype!="adfree" && $con_advtype!="delay"

----------------------------------
NOW let’s add member management features for new category
----------------------------------

Yet again add template text for category:

$template->assign("text_406", $text_406);

To these sections:

##################################
#### The saving of member edit ####
##################################

##################################
#### The member edit screen ####
##################################



There! New category is set to the admin with these functions: ADD, EDIT, DELETE. Any kind of category can be add this way, but it works like adfree...

You can even add multilpe new categories: just assing new text number to language-file and use something else instead of “delay” or other ones already in use.

Next we want to add delay-functionality...

-------------------------
*** FILE: index.php

FIND (hint: at the end of the file):
<html>
<head>
<title><?php echo stripslashes($row[title]) ?></title>
<meta name="keywords" content="<?php echo stripslashes($row[keyw]) ?>">
<meta name="description" content="<?php echo stripslashes($row[descr]) ?>">
<meta name="revisit-after" content="<?php echo stripslashes($row[revisit]) ?>">
<meta name="robots" content="<?php echo stripslashes($row[robots]) ?>">
</head>
<?php
if ($catrow[advtype]=="adfree" || $row[adtype]=="off") {
?>
<frameset rows="100%,*" frameborder="NO" border="0" framespacing="0">
<frame name="main" src="<?php echo $target_url ?>">
<?php
}
if ($catrow[advtype]=="upperframe" && $row[adtype]=="on") {
?>
<frameset rows="<?php echo $catrow[height] ?>,*" frameborder="NO" border="0" framespacing="0">
<frame name="ad" src="<?php echo stripslashes($catrow[adurl]) ?>" noresize scrolling="no">
<frame name="main" src="<?php echo $target_url ?>">
<?php
}
if ($catrow[advtype]=="lowerframe" && $row[adtype]=="on") {
?>
<frameset rows="*,<?php echo $catrow[height] ?>" frameborder="NO" border="0" framespacing="0">
<frame name="main" src="<?php echo $target_url ?>">
<frame name="ad" src="<?php echo stripslashes($catrow[adurl]) ?>" noresize scrolling="no">
<?php
}
if ($catrow[advtype]=="popup" && $row[adtype]=="on") {
?>
<script language="JavaScript">
<!--
function PopUpBanner() {
var windowoptions = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes,left=50,top=50,width=<?php echo $catrow[width] ?>,height=<?php echo $catrow[height] ?>";
myredpopup = open('<?php echo stripslashes($catrow[adurl]) ?>',"AdPopup",windowoptions);
myredpopup.focus();
}
PopUpBanner();
// -->
</script>
<frameset rows="100%,*" frameborder="NO" border="0" framespacing="0">
<frame name="main" src="<?php echo $target_url ?>">
<?php
}
?>
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000">
<a href="<?php echo $target_url ?>">Click here to continue to <?php echo stripslashes($row[title]) ?></a>
</body>
</noframes>
</html>



REPLACE IT WITH THIS:

<html>
<head>
<title><?php echo stripslashes($row[title]) ?></title>
<meta name="keywords" content="<?php echo stripslashes($row[keyw]) ?>">
<meta name="description" content="<?php echo stripslashes($row[descr]) ?>">
<meta name="revisit-after" content="<?php echo stripslashes($row[revisit]) ?>">
<meta name="robots" content="<?php echo stripslashes($row[robots]) ?>">
<?php
if ($catrow[advtype]=="delay" && $row[adtype]=="on") {
?>
<meta http-equiv="refresh" content="5; url=<?php echo $target_url ?>">
<?php
}
?>
</head>
<?php
if ($catrow[advtype]=="adfree" || $row[adtype]=="off") {
?>
<frameset rows="100%,*" frameborder="NO" border="0" framespacing="0">
<frame name="main" src="<?php echo $target_url ?>">
<?php
}
if ($catrow[advtype]=="upperframe" && $row[adtype]=="on") {
?>
<frameset rows="<?php echo $catrow[height] ?>,*" frameborder="NO" border="0" framespacing="0">
<frame name="ad" src="<?php echo stripslashes($catrow[adurl]) ?>" noresize scrolling="no">
<frame name="main" src="<?php echo $target_url ?>">
<?php
}
if ($catrow[advtype]=="lowerframe" && $row[adtype]=="on") {
?>
<frameset rows="*,<?php echo $catrow[height] ?>" frameborder="NO" border="0" framespacing="0">
<frame name="main" src="<?php echo $target_url ?>">
<frame name="ad" src="<?php echo stripslashes($catrow[adurl]) ?>" noresize scrolling="no">
<?php
}
if ($catrow[advtype]=="popup" && $row[adtype]=="on") {
?>
<script language="JavaScript">
<!--
function PopUpBanner() {
var windowoptions = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes,left=50,top=50,width=<?php echo $catrow[width] ?>,height=<?php echo $catrow[height] ?>";
myredpopup = open('<?php echo stripslashes($catrow[adurl]) ?>',"AdPopup",windowoptions);
myredpopup.focus();
}
PopUpBanner();
// -->
</script>
<frameset rows="100%,*" frameborder="NO" border="0" framespacing="0">
<frame name="main" src="<?php echo $target_url ?>">
<?php
}
?>
<?php
if ($catrow[advtype]=="delay" && $row[adtype]=="on") {
?>

<body>
<table cellpadding=3 width="95%" align=center border=0 bgcolor="#99CCFF">
<tbody>
<tr>
<td bgcolor="#99CCFF">
<p>Wait 5 seconds.....</p>
</td>
</tr>
<tr>
<td> </td>
</tr>
</tbody>
</table>
<br>
<table border="0" cellpadding="3" cellspacing="0" width="95%" align="center">
<tr>
<td width="90%" valign="top" bgcolor="#FFFFFF">
<p> </p>
<p>&nbsp;</p>
<p><b>The site <?php echo stripslashes($row[title]) ?> is using our fabulous redirections service.<br><br>You will redirected to <?php echo stripslashes($row[title]) ?> within 5 seconds.<br>
<br><br><br>Want to know more? Visit our webpage and register too!</b></p>
</td>
</tr>
</table>
<br>
<table width="95%" align=center border=0 bgcolor="#99CCFF">
<tbody>
<tr>
<td bgcolor="#99CCFF">
<div align=right>powered by <a
href="http://www.milliscript.com/" target="_blank">Milliscript</a></div>
</td>
</tr>
</tbody>
</table>
<p> </p>
</body>

<?php
} else {
?>


</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000">
<a href="<?php echo $target_url ?>">Click here to continue to <?php echo stripslashes($row[title]) ?></a>
</body>
</noframes>

<?php
}
?>

</html>
---------------------------------------

WOW! everything should work swell!
Ternet
Newbie
Newbie
 
Posts: 1
Joined: Thu Sep 15, 2005 11:24 am

Return to Suggestions

Who is online

Users browsing this forum: No registered users and 9 guests

cron