Author |
Message |
papamike
Theme Guru
![](modules/Forums/images/avatars/10597490775cd5edd76980e.jpg)
Joined: Jan 11, 2006
Posts: 170
|
Posted:
Tue Feb 15, 2011 1:07 am |
|
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
Mike (papamike) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Susann
Moderator
![](modules/Forums/images/avatars/4e3210db4efb891870d79.gif)
Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support
|
Posted:
Tue Feb 15, 2011 3:26 am |
|
Do you mean "Theme preview by Viperal" ? You will find it here under downloads. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
papamike
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 15, 2011 3:30 am |
|
Thanks Susann I've got it now. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
EmeraldDragon
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/14503575485f650026785ad.jpg)
Joined: Sep 18, 2020
Posts: 20
|
Posted:
Sun Sep 20, 2020 2:19 pm |
|
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]
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/5ed231554a8492e2e09da.gif)
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Mon Sep 21, 2020 5:25 pm |
|
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. |
Description: |
|
![](modules/Forums/images/icon_clip.gif) Download |
Filename: |
modules-Themes_System.zip |
Filesize: |
81.77 KB |
Downloaded: |
172 Time(s) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
EmeraldDragon
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 21, 2020 5:27 pm |
|
Thanks hicuxunicorniobestbuildpc. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
EmeraldDragon
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Sep 25, 2020 12:30 pm |
|
I guess it didn't work. But thanks anyway... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
EmeraldDragon
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Oct 05, 2020 3:29 pm |
|
It would be nice if someone has the latest version of this block. I would still like to obtain it. (if possible) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
Site Admin
![](modules/Forums/images/avatars/201442295664a46e4575d46.jpg)
Joined: Aug 22, 2007
Posts: 1775
|
Posted:
Tue Oct 06, 2020 1:01 pm |
|
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;
|
|
_________________ Only registered users can see links on this board! Get registered or login!
Description: |
|
![](modules/Forums/images/icon_clip.gif) Download |
Filename: |
block-RN_Theme_Preview.zip |
Filesize: |
1.12 KB |
Downloaded: |
182 Time(s) |
Last edited by neralex on Tue Oct 06, 2020 1:11 pm; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
EmeraldDragon
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 06, 2020 1:11 pm |
|
neralex,
Thanks. I didn't know you can do that. I am new to RavenNuke. ![Laughing](modules/Forums/images/smiles/icon_lol.gif) |
Last edited by EmeraldDragon on Tue Oct 06, 2020 1:17 pm; edited 2 times in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 06, 2020 1:17 pm |
|
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](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
EmeraldDragon
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 06, 2020 1:18 pm |
|
Not what I was expecting, but I'll take it.
Popup screen Theme Preview |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 06, 2020 1:36 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
EmeraldDragon
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 06, 2020 2:53 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 07, 2020 4:08 pm |
|
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;
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Oct 08, 2020 12:23 pm |
|
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](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
EmeraldDragon
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Oct 08, 2020 2:41 pm |
|
Thanks, I'll check it out when I have a chance. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
freekays
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/Misc/l10.gif)
Joined: Apr 18, 2012
Posts: 5
|
Posted:
Sun Jun 05, 2022 6:33 pm |
|
EmeraldDragon wrote: | Thanks, I'll check it out when I have a chance. |
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|