Author |
Message |
Doulos
Life Cycles Becoming CPU Cycles

Joined: Jun 06, 2005
Posts: 732
|
Posted:
Mon Mar 20, 2006 3:53 am |
|
I am looking for a copy of a themes preview block that works with RN2.02. All the links I have found are dead.
? can ya help me out ?
Here is the one I have:
Code:<?php
// ---------------------------------------------------------------------- //
// Preview theme block v1.0 //
// ---------------------------------------------------------------------- //
// Copyright (C) 2003 DJ Maze < http://tunesplayer.com > //
// ---------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// ---------------------------------------------------------------------- //
if (eregi("block-Preview_theme.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $name, $op;
$qs = "?";
foreach($_GET as $var => $value) {
if ($var != "prevtheme") {
$qs .= $var."=".$value.= "&";
}
if ($var == $name) $self = 'modules.php';
}
if (!isset($self)) {
if ($op && $_SERVER['PHP_SELF'] != 'modules.php')
$self = 'admin.php';
else
$self = 'index.php';
}
$ThemeSel = get_theme();
$content = '<center><form action="" method="get"><select name="themeprev" onChange="top.location.href=this.options[this.selectedIndex].value">';
//$content = '<center><form action="index.php" method="get" onChange="submit();"><b>Preview Theme</b><br><select name="prevtheme">';
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ( (!ereg("[.]",$file) AND file_exists("themes/$file/theme.php")) ) {
$themelist .= "$file ";
}
}
closedir($handle);
$themelist = explode(" ", $themelist);
sort($themelist);
for ($i=0; $i < sizeof($themelist); $i++) {
if($themelist[$i]!="") {
$content .= "<option value=\"{$self}{$qs}prevtheme=$themelist[$i]\"";
if($themelist[$i]==$ThemeSel) $content .= " selected";
$content .= ">$themelist[$i]";
if ($tfile=@opendir("themes/$themelist[$i]/forums")) $content .= " *";
$content .= "</option>\n";
}
}
$content .= '</select><br>
<br>Copyright © 2005<br><a href="http://www.phpnuke-clan.com" target="_blank">PHPNUKE-CLAN.COM</a></form></center>';
?>
|
They say it only works on phpnuke-clan BETA v1.1, but it was the only one I could find so I tried it. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Mon Mar 20, 2006 5:52 am |
|
Quote: |
They say it only works on phpnuke-clan BETA v1.1, but it was the only one I could find so I tried it.
|
Ok, so you tried it, but did it work? If not, what happened? |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Doulos

|
Posted:
Mon Mar 20, 2006 9:27 am |
|
I appears and looks good - exactly like the ones I see on other nuke sites. When I choose a different them it acts like it is changing but it just "changes" to the same theme it was on.
Edit: It shows the current theme and the list of other available themes, but won't switch to them. |
|
|
|
 |
Doulos

|
Posted:
Sat Apr 01, 2006 10:45 pm |
|
I found one that will work. block-Random_Theme.php (don't remember where I got it). I just commented-out the random part of it and it works great. Here is code (including random):Code:$themelist = explode(" ", $themelist);
sort($themelist);
for ($i=0; $i < sizeof($themelist); $i++) {
if($themelist[$i]!="") {
$content .= "<option value=\"$themelist[$i]\" ";
if((($userinfo[theme]=="") && ($themelist[$i]=="$Default_Theme")) || ($userinfo[theme]==$themelist[$i])) $content .= "selected";
$content .= ">$themelist[$i]\n";
}
}
if($userinfo[theme]=="") $userinfo[theme] = "$Default_Theme";
$content .= "</select><br>";
$content .= "<br>";
$content .= "<input type=\"hidden\" name=\"user_id\" value=\"$userinfo[user_id]\">";
$content .= "<input type=\"hidden\" name=\"op\" value=\"savetheme\">";
$content .= "<input type=\"submit\" value=\"Select\">";
$content .= "</form>";
$handle = opendir('themes');
$themeArray = array();
while($file = readdir($handle)) {
if ( (!ereg("[.]",$file)) ) {
array_push( $themeArray, $file );
}
}
closedir( $handle );
// Below line should not be needed as PHP 4.2.0 and up automatically seed
// mt_rand - Greg
mt_srand( (double)microtime( ) * 1000000 );
$randval = mt_rand( 0, sizeof( $themeArray ) - 1 );
$randtheme = $themeArray[$randval];
$content .= "<center>";
$content .= "<form action=\"account.html\" method=\"post\">";
$content .= "<input type=\"hidden\" name=\"user_id\" value=\"$userinfo[user_id]\">";
$content .= "<input type=\"hidden\" name=\"theme\" value=\"$randtheme\">";
$content .= "<input type=\"hidden\" name=\"op\" value=\"savetheme\">";
$content .= "<input type=\"submit\" value=\"Random\">";
$content .= "</form>";;
} else {
$content .= "<center>";
$content .= "This module for registered users only";
$content .= "</center>";
}
?>
|
If you comment-out these lines it works without the Random option:Code:// mt_rand - Greg
//mt_srand( (double)microtime( ) * 1000000 );
//$randval = mt_rand( 0, sizeof( $themeArray ) - 1 );
//$randtheme = $themeArray[$randval];
//$content .= "<center>";
//$content .= "<form action=\"account.html\" method=\"post\">";
//$content .= "<input type=\"hidden\" name=\"user_id\" value=\"$userinfo[user_id]\">";
//$content .= "<input type=\"hidden\" name=\"theme\" value=\"$randtheme\">";
//$content .= "<input type=\"hidden\" name=\"op\" value=\"savetheme\">";
//$content .= "<input type=\"submit\" value=\"Random\">";
//$content .= "</form>";;
|
|
|
|
|
 |
montego

|
Posted:
Sun Apr 02, 2006 7:25 am |
|
Ezekiel, my appologies for missing the follow-up on this one! Glad you found something that worked well for you. |
|
|
|
 |
shotokan
Worker


Joined: Aug 27, 2006
Posts: 172
|
Posted:
Mon Aug 28, 2006 2:38 pm |
|
I am still looking for the original theme preview block. Do you know where to find it? |
|
|
|
 |
montego

|
Posted:
Tue Aug 29, 2006 12:45 am |
|
shotokan wrote: | I am still looking for the original theme preview block. Do you know where to find it? |
No, however, the name Viseral or Visperal(?) seems to pop into my head... |
|
|
|
 |
montego

|
Posted:
Tue Aug 29, 2006 12:45 am |
|
Actually, you might want to ask Jaded as she may even be using it on her site... |
|
|
|
 |
shotokan

|
Posted:
Tue Aug 29, 2006 6:13 am |
|
I got it yesterday from another post on this forum. Thanks. |
|
|
|
 |
montego

|
Posted:
Tue Aug 29, 2006 9:55 am |
|
|
|
 |
|