Elxis CMS Forum
Support => Technical support => Topic started by: elpvn on December 22, 2009, 15:07:01
-
Hi everyone,
For advertising reason, I want to put an ads page on first time for anyone enter my website (powered by Elxis CMS). So how to create a redirect page (code or script) on first time enter the site? (just show at the first time for each section only)
Thanks for help and support.
-
in your template's index.php inside <body>
try this
<?php if (($_SESSION['flashintro'] != 1) && ($option == 'com_frontpage')) {
$_SESSION['flashintro'] = 1;
?>
<div id="overlayflash">
<object type="application/x-shockwave-flash" data="http://www....../intro.swf" width="900" height="900">
<param name="movie" value="http://www......../intro.swf" />
<param name="wmode" value="opaque">
</object>
</div>
<?php } ?>
we don't set a redirection... it is better for seo optimization to set an overlay div (properly css customized) to float above
and here is the css example:
#overlayflash {
width:100%;
height:1900px; /*higher than current page height*/
background:#FFFF00!important;
z-index:99999;
position:absolute;
top: 0; right: 0; bottom: 0; left: 0;
text-align:center;
}
EDIT:
You must know that search engines might give a penalty to your site if ...
1- your site redirects visitors to other pages once reaching your site
2- you are showing to visitors other content than what the search engine actually sees!
-
Thanks Ks-net,
Great idea! But it not work on my website T_T
Maybe still missing something?
Thanks again :)
-
which part fails?
flash
css
session
-
Hi,
Maybe session? I think so :)
Great support ^^
-
i think it is most likely the odject.. flash paths etc...
test first your session...
eg.
<?php if (($_SESSION['flashintro'] != 1) && ($option == 'com_frontpage')) {
$_SESSION['flashintro'] = 1;
?>
<div >
<h1>hello world</h1>
</div>
<?php } ?>
remember.. only at home page and only one time it will appear the "hello world" text... in next reload-visit it will disappear,
to test it again you have first to clear-reset your stored session => clear browser cookies or close-reopen browser.
edit:
all above code and examples .. are real working examples... they are working online at this time!
-
Hello ks-net,
Well, it's still not work at me, but easier to visualize, your can visit this site as an example:
http://vozforums.com/ (http://vozforums.com/)
You will see that in first time enter the site: http://vozforums.com/ then this site will be redirects to http://vozforums.com/specials/intro.php?next=%2F (http://vozforums.com/specials/intro.php?next=%2F) (an advertising page) but in next reload/visit it will disappear. Is a commercial script or not? How to get it to work on my personal site (powered by Elxis CMS)? Maybe help me a full code/script with this feature?
Special thanks for help and continous support :)
e l p
-
εχω το εξης πρόβλημα στην γραμμή "<?php if (($_SESSION['flashintro'] != 1) && ($option == 'com_frontpage')) {" .
όταν βάζω και το δεύτερο "όρισμα" με το con_frontpage δεν εκτελείται καθόλου η εντολή. υπάρχει κάποιος άλλος τρόπος να μπορώ να εκτελώ τις εντολές μέσα στο if χωρίς το con_frontpage αλλά για την πρώτη φορά που μπαίνει κάποιος στο site? ευχαριστώ...
-
please write in English in this topic(modify-translate or move your post to greek section)
<?php if ($_SESSION['flashintro'] != 1) {
$_SESSION['flashintro'] = 1;
?>
<div >
<h1>hello world</h1>
</div>
<?php } ?>
******
Hello ks-net,
Well, it's still not work at me, but easier to visualize, your can visit this site as an example:
you insist on redirecting to an html page but my method is only placing an overlay div
maybe you don't have com_frontpage as first page but other page?
try this to check:
<?php if ($_SESSION['flashintro'] != 1) {
$_SESSION['flashintro'] = 1;
?>
<div >
<h1>hello world</h1>
</div>
<?php } ?>
-
yes that was it ! instead of con_frontpage I have con_reservations !
solved ! thanks
-
Kostas please rename this subject as SOLVED! ::) 8)
-
Hi, I have this code in my site
--------------------------------
<?php if (($_SESSION['flashintro'] != 1) && ($option == 'com_reservations')) {
$_SESSION['flashintro'] = 1;
?>
<div id="overlayflash">
<iframe src="<?php echo $mainframe->getCfg('ssl_live_site'); ?>/main-index.html" width="100%" height="1000" frameborder="0" > </iframe>
</div>
<?php } ?>
-----------------------------
it's working, but there is one problem. When I wanna browse i.e. this site http://www.ibooking.gr/reservations/zagorohoria/ksenodokheio-ntobra.html it's still for the first time appears the splash screen. I want to appear the splash screen only when someone browse -for the first time- this site http://www.ibooking.gr/ not all "sections" of com_reservations..
thanks