Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
Doulos
Life Cycles Becoming CPU Cycles



Joined: Jun 06, 2005
Posts: 732

PostPosted: Mon Mar 20, 2006 3:53 am Reply with quote

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.
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Mon Mar 20, 2006 5:52 am Reply with quote

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?

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Doulos







PostPosted: Mon Mar 20, 2006 9:27 am Reply with quote

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







PostPosted: Sat Apr 01, 2006 10:45 pm Reply with quote

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







PostPosted: Sun Apr 02, 2006 7:25 am Reply with quote

Ezekiel, my appologies for missing the follow-up on this one! Embarassed Glad you found something that worked well for you.
 
shotokan
Worker
Worker



Joined: Aug 27, 2006
Posts: 172

PostPosted: Mon Aug 28, 2006 2:38 pm Reply with quote

I am still looking for the original theme preview block. Do you know where to find it?
 
View user's profile Send private message
montego







PostPosted: Tue Aug 29, 2006 12:45 am Reply with quote

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







PostPosted: Tue Aug 29, 2006 12:45 am Reply with quote

Actually, you might want to ask Jaded as she may even be using it on her site...
 
shotokan







PostPosted: Tue Aug 29, 2006 6:13 am Reply with quote

I got it yesterday from another post on this forum. Thanks.
 
montego







PostPosted: Tue Aug 29, 2006 9:55 am Reply with quote

Ok. Great!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©