Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Themes
Author Message
papamike
Theme Guru



Joined: Jan 11, 2006
Posts: 170

PostPosted: Tue Feb 15, 2011 1:07 am Reply with quote

Does anyone have the mod that displays themes that are chosen from a drop down menu. Once chosen from the drop down menu the site changes to that theme.

Thanks worship

Mike (papamike)
 
View user's profile Send private message
Susann
Moderator



Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Tue Feb 15, 2011 3:26 am Reply with quote

Do you mean "Theme preview by Viperal" ? You will find it here under downloads.
 
View user's profile Send private message
papamike







PostPosted: Tue Feb 15, 2011 3:30 am Reply with quote

Thanks Susann I've got it now.
 
EmeraldDragon
New Member
New Member



Joined: Sep 18, 2020
Posts: 20

PostPosted: Sun Sep 20, 2020 2:19 pm Reply with quote

Sorry about digging out the old post, but instead of starting a new one. I figured I should asked here.

Trying to find out if "Theme preview by Viperal" , I tried to search in the download area. But I couldn't find anything.

_________________
Emerald Dragon [AKA: WebSiteGuru]  
View user's profile Send private message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1027
Location: Netherland

PostPosted: Mon Sep 21, 2020 5:25 pm Reply with quote

I don't know if it is this one but I found this one on my old files. I guess it is really old. Let me know.



modules-Themes_System.zip
 Description:
themes system

Download
 Filename:  modules-Themes_System.zip
 Filesize:  81.77 KB
 Downloaded:  11 Time(s)

 
View user's profile Send private message Visit poster's website
EmeraldDragon







PostPosted: Mon Sep 21, 2020 5:27 pm Reply with quote

Thanks hicuxunicorniobestbuildpc.
 
EmeraldDragon







PostPosted: Fri Sep 25, 2020 12:30 pm Reply with quote

I guess it didn't work. But thanks anyway...
 
EmeraldDragon







PostPosted: Mon Oct 05, 2020 3:29 pm Reply with quote

It would be nice if someone has the latest version of this block. I would still like to obtain it. (if possible)
 
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1611

PostPosted: Tue Oct 06, 2020 1:01 pm Reply with quote

EmeraldDragon, I used the Theme-Preview function in the admin-section of RN25x to build a simple block-file with the same functionality, which is using the uploaded themes from the themes-folder of your installation. The block contains an unordered list, which be can styled with css-classes (placed in your style.css of the used theme) as you like.

Create a php-file like: block-RN_Theme_Preview.php and paste the following code into it.

php Code:
<?php

/**
* RN Theme Preview Block
* @package RavenNuke 2.5x
* @copyright (c) 2020 Raven PHP Scripts (neralex)
* @link http://www.ravenphpscripts.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('BLOCK_FILE')) {
Header('Location: ../index.php');
die();
}
global $prefix, $db;

addJSToBody('includes/jquery/jquery.cookie.js', 'file');

$dom = PHP_EOL . '<script type="text/javascript">
$(document).ready(function () {
var setCookieName = "Theme_Preview"
var setCookieExpire = "";
var setCookiePath = "/";
var setCookieDomain = "";
var setCookieSecure = false;

$("a.PreviewTheme").click(function () {
var theme = $(this).attr("id");
theme = theme.substr(1);
var url = $(this).attr("href");
$.colorbox({
href: url,
width:"95%",
height:"95%",
iframe:true,
onOpen:function(){ Cookies.set(setCookieName, theme, { expires: setCookieExpire, path: setCookiePath, domain: setCookieDomain, secure: setCookieSecure }); },
onCleanup:function(){ Cookies.set(setCookieName, "0", { expires: -1, path: setCookiePath, domain: setCookieDomain, secure: setCookieSecure }); }
});
return false;
});
});' . PHP_EOL;
$dom .= '</script>' . PHP_EOL;
addJSToBody($dom,'inline');

$content = '';

$content .= '<ul>' . PHP_EOL;
$results = $db->sql_query('SELECT `Default_Theme` FROM `' . $prefix . '_config`');
$config = $db->sql_fetchrow($results, SQL_ASSOC);
$result = $db->sql_query('SELECT * FROM `' . $prefix . '_themes` ORDER BY `themename` ASC');
$row = $db->sql_fetchrowset($result, SQL_ASSOC);
foreach($row as $key => $val) {
if ($val['theme'] == $config['Default_Theme']) {
$sel = ' thick';
} else {
$sel = '';
}
if ($val['theme'] != '' && $val['themename'] != '') {
$content .= '<li class="' . $val['theme'] . $sel . '"><a id="a' . $val['theme'] . '" class="PreviewTheme" href="./" title="Preview ' . ($sel != '' ? 'Default ' : '') . 'Theme: ' . $val['themename'] . '">' . $val['themename'] . '</a></li>' . PHP_EOL;
}
}
$content .= '</ul>' . PHP_EOL;

_________________
Github: RavenNuke


block-RN_Theme_Preview.zip
 Description:

Download
 Filename:  block-RN_Theme_Preview.zip
 Filesize:  1.12 KB
 Downloaded:  10 Time(s)



Last edited by neralex on Tue Oct 06, 2020 1:11 pm; edited 1 time in total 
View user's profile Send private message
EmeraldDragon







PostPosted: Tue Oct 06, 2020 1:11 pm Reply with quote

neralex,

Thanks. I didn't know you can do that. I am new to RavenNuke. Laughing


Last edited by EmeraldDragon on Tue Oct 06, 2020 1:17 pm; edited 2 times in total 
neralex







PostPosted: Tue Oct 06, 2020 1:17 pm Reply with quote

Some things are more easier than you think and were implemented in RN many years ago. Try it out and report found issues. Cheers Wink
 
EmeraldDragon







PostPosted: Tue Oct 06, 2020 1:18 pm Reply with quote

Not what I was expecting, but I'll take it. Very Happy

Popup screen Theme Preview
 
neralex







PostPosted: Tue Oct 06, 2020 1:36 pm Reply with quote

Ya, but display themes that are chosen from a drop down menu should only be provided for users, which are logged in (like the theme-switcher in Your_Account) otherwise you would give everyone the possibility to change your default-theme and I guess this is not really what do you want.
 
EmeraldDragon







PostPosted: Tue Oct 06, 2020 2:53 pm Reply with quote

neralex wrote:
Ya, but display themes that are chosen from a drop down menu should only be provided for users, which are logged in (like the theme-switcher in Your_Account) otherwise you would give everyone the possibility to change your default-theme and I guess this is not really what do you want.


Yeah, I wishes it was dropdown menu option. It's just only means for users to preview themes that I will make. So, they can see the functionality of it. It's not a means to changed the default theme for the users. But that will do thou. Not unless, the block can be converted to dropdown option.
 
hicuxunicorniobestbuildpc







PostPosted: Wed Oct 07, 2020 4:08 pm Reply with quote

I got this one as well.

Code:
<?php

if ( !defined('BLOCK_FILE') ) {Header('Location: ../index.php'); die();}
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");
global $user, $ThemeSel;
$content = '';
if (is_user($user)) {
   $userinfo = getusrinfo($user);
   $folder = 'themes';
   if (is_dir($folder)) {
      $content .= '<form action="modules.php" method="post">' . PHP_EOL
              . '<div class="text-center">' . PHP_EOL
              . '<select name="theme" onchange="submit();">' . PHP_EOL;
      $themelist = scandir($folder);
      sort($themelist);
      $count_themelist = count($themelist);
      $exclude = array('.','..');
      for ($i=0; $i < $count_themelist; $i++) {
         if (is_dir($folder . '/' . $themelist[$i]) && !in_array($themelist[$i], $exclude)) {
            $content .= '   <option value="' . $themelist[$i] . '"' . ($themelist[$i] == $ThemeSel ? ' selected="selected"' : '') . '>' . $themelist[$i] . '</option>' . PHP_EOL;
         }
      }
      unset($themelist);
      $content .= '</select>' . PHP_EOL
              . '<input type="hidden" name="user_id" value="' . $userinfo['user_id'] . '" />' . PHP_EOL
              . '<input type="hidden" name="name" value="Your_Account" />' . PHP_EOL
              . '<input type="hidden" name="op" value="savetheme" />' . PHP_EOL
              . '</div>' . PHP_EOL
              . '</form>' . PHP_EOL;       
   }
} else {
   $userinfo = array();
   $content .= '<div class="text-center">Only for users!</div>' . PHP_EOL;
}
 
neralex







PostPosted: Thu Oct 08, 2020 12:23 pm Reply with quote

hicuxunicorniobestbuildpc, yes this is the solution for logged-in users, only. I knew that I had done this before but unfortunately I couldn't find the file anymore, thanks! Wink
 
EmeraldDragon







PostPosted: Thu Oct 08, 2020 2:41 pm Reply with quote

Thanks, I'll check it out when I have a chance.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Themes

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 ©