*

Recent

Author Topic: [Add On] Simple Template CSS Switcher  (Read 4941 times)

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
[Add On] Simple Template CSS Switcher
« on: January 04, 2015, 03:57:39 PM »
Want to allow your users to choose any color theme they want for your arcade?



This Mod is for you!

Download simple-css-switcher.zip and upload style to templates/simple/
Upload contents of images to images in root of your arcade.
*Note* This Mod is for Simple Template Only => http://freearcadescript.net/forums/index.php?topic=818.0

Includes new purple.css

Edit index.php
Find:
Code: [Select]
include ('includes/functions.php');
include ('includes/core.php');
include('includes/rating_functions.php');
include('includes/reset.php');

Add After:
Code: [Select]

if(isset($_GET['css'])){
switch ($_GET['css']) {

case 'purple':
$stylesheet = '<link rel="stylesheet" type="text/css" href="'.$domain.'/templates/'.$template.'/style/purple.css">';
$_SESSION['switchcss']=$stylesheet;
break;

case 'green':
$stylesheet = '<link rel="stylesheet" type="text/css" href="'.$domain.'/templates/'.$template.'/style/green.css">';
$_SESSION['switchcss']=$stylesheet;
break;

case 'pink':
$stylesheet = '<link rel="stylesheet" type="text/css" href="'.$domain.'/templates/'.$template.'/style/pink.css">';
$_SESSION['switchcss']=$stylesheet;
break;

case 'black':
$stylesheet = '<link rel="stylesheet" type="text/css" href="'.$domain.'/templates/'.$template.'/style/black.css">';
$_SESSION['switchcss']=$stylesheet;
break;

default:
$stylesheet = '<link rel="stylesheet" type="text/css" href="'.$domain.'/templates/'.$template.'/style/blue.css">';
$_SESSION['switchcss']=$stylesheet;
}
}

templates/simple/template.php
Find:
Code: [Select]
<link href="<?=$domain?>/templates/<?php echo $template ?>/styles.css" rel="stylesheet" type="text/css">

Replace with:
Code: [Select]
<?php echo ($_SESSION['switchcss'])? $_SESSION['switchcss']: '<link href="'.$domain.'/templates/'.$template.'/style/blue.css" type="text/css" rel="stylesheet">';?>

Find:
Code: [Select]
<?php
if (!$socialmedia1 == "") { echo '<a href="'.$socialmedia1.'"><img src="'.$domain.'/images/icons/facebook.png" alt="FaceBook" title="FaceBook" width="16" height="16" /></a> '; };
if (!
$socialmedia2 == "") { echo '<a href="'.$socialmedia2.'"><img src="'.$domain.'/images/icons/twitter.png" alt="Twitter" title="Twitter" width="16" height="16" /></a> '; };
if (!
$socialmedia3 == "") { echo '<a href="'.$socialmedia3.'"><img src="'.$domain.'/images/icons/googleplus.png" alt="Google Plus" title="Google Plus" width="16" height="16" /></a> '; };
if (!
$socialmedia4 == "") { echo '<a href="'.$socialmedia4.'"><img src="'.$domain.'/images/icons/linkedin.png" alt="Linkedin" title="Linkedin" width="16" height="16" /></a> '; };
if (!
$socialmedia5 == "") { echo '<a href="'.$socialmedia5.'"><img src="'.$domain.'/images/icons/pinterest.png" alt="Pinterest" title="Pinterest" width="16" height="16" /></a> '; };
if (!
$socialmedia6 == "") { echo '<a href="'.$socialmedia6.'"><img src="'.$domain.'/images/icons/youtube.png" alt="You Tube" title="You Tube" width="16" height="16" /></a> '; };
if (!
$socialmedia7 == "") { echo '<a href="'.$socialmedia7.'"><img src="'.$domain.'/images/icons/myspace.png" alt="MySpace" title="MySpace" width="16" height="16" /></a> '; };
if (!
$socialmedia8 == "") { echo '<a href="'.$socialmedia8.'"><img src="'.$domain.'/images/icons/stumbleupon.png" alt="StumbleUpon" title="StumbleUpon" width="16" height="16" /></a> '; };
if (!
$socialmedia9 == "") { echo '<a href="'.$socialmedia9.'"><img src="'.$domain.'/images/icons/digg.png" alt="Digg" title="Digg" width="16" height="16" /></a> '; };
if (!
$socialmedia10 == "") { echo '<a href="'.$socialmedia10.'"><img src="'.$domain.'/images/icons/icon4.png" alt="" title="" width="16" height="16" /></a> '; };
?>


Add After:
Code: [Select]
<br />
Choose Style :
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?css=pink"><img src="<?=$domain?>/images/pink.png" alt="pink" width="10" height="10"/></a> | <a href="<?php echo $_SERVER['PHP_SELF']; ?>?css=purple"><img src="<?=$domain?>/images/purple.png" alt="purple" width="10" height="10"/></a> | <a href="<?php echo $_SERVER['PHP_SELF']; ?>?css=default"><img src="<?=$domain?>/images/blue.png" alt="blue" width="10" height="10"/></a> | <a href="<?php echo $_SERVER['PHP_SELF']; ?>?css=green"><img src="<?=$domain?>/images/green.png" alt="green" width="10" height="10"/></a> | <a href="<?php echo $_SERVER['PHP_SELF']; ?>?css=black"><img src="<?=$domain?>/images/black.png" alt="black" width="10" height="10"/></a>
« Last Edit: January 04, 2015, 05:39:34 PM by am-fs »