Author |
Message |
shotokan
Worker


Joined: Aug 27, 2006
Posts: 172
|
Posted:
Mon Sep 18, 2006 7:56 am |
|
I was using these block with my php-nuke7.0 without a problem but i decided to have another php-nuke installation (7.8 patched 3.2b) in another directory to try that out and the nuke 7.8 patched is fine but the block is not working. It does change the theme but seems like the site is not allowing me to go back to "home" anymore and not see other parts. too
I did the changes on the install.txt but some of the code changes especially the one for modules/your_account is a little differenct in 7.8 and i don;t know what else i need to change.
##================================================
## Viperal's Theme Preview Block (PHP-Nuke 7.4+)
##================================================
Copy the block-Preview_Theme.php file to your blocks folder then go to blocks admin and
activate it.
Next: Copy the vpreview folder to your /images/ folder.
===============================================
Open your mainfile.php file and look for the following:===============================================
Find:
function get_theme() {
global $user, $cookie, $Default_Theme;
static $ThemeSelSave;
if (isset($ThemeSelSave)) return ($ThemeSelSave);
if(is_user($user)) {
$user2 = base64_decode($user);
$t_cookie = explode(":", $user2);
if($t_cookie[9]=="") $t_cookie[9]=$Default_Theme;
if(isset($theme)) $t_cookie[9]=$theme;
if(!$tfile=@opendir("themes/$t_cookie[9]")) {
$ThemeSel = $Default_Theme;
} else {
$ThemeSel = $t_cookie[9];
}
} else {
$ThemeSel = $Default_Theme;
}
$ThemeSelSave = $ThemeSel;
return($ThemeSel);
}
Replace with this:
function get_theme() {
global $user, $db, $user_prefix, $Default_Theme;
static $theme = false;
if ($theme)
{
return $theme;
}
$theme = (isset($_COOKIE['theme'])) ? base64_decode($_COOKIE['theme']) : false;
if (isset($_POST['themeprev']) && $theme != $_POST['themeprev'] && file_exists('themes/'.$_POST['themeprev'].'/theme.php'))
{
$theme = $_POST['themeprev'];
setcookie('theme',base64_encode($theme), 0);
if (is_user($user)) {
$user2 = explode(":", base64_decode(addslashes($user)));
$user_id = intval($user2[0]);
$info = base64_encode("$user2[0]:$user2[1]:$user2[2]:$user2[3]:$user2[4]:$user2[5]:$user2[6]:$user2[7]:$user2[8]:$theme:$user2[10]");
setcookie("user","$info",time()+2592000);
$db->sql_query("UPDATE ".$user_prefix."_users SET theme='$theme' WHERE user_id='$user_id'");
}
return $theme;
} elseif ($theme && file_exists('themes/'.$theme.'/theme.php')) {
return $theme;
}
if (!is_user($user)) {
$theme = $Default_Theme;
return $theme;
}
$user = addslashes($user);
$user2 = base64_decode($user);
$user2 = explode(":", $user2);
if($user2[9])
{
if(!file_exists('themes/'.$user2[9].'/theme.php')) {
$theme = $Default_Theme;
} else {
$theme = $user2[9];
}
} else {
$theme = $Default_Theme;
}
return $theme;
}
#
#save and close file
#
=============================================
Go to modules/Your_Account folder and open your index.php file then look for the following:
==========================================
function savetheme($user_id, $theme) {==========================================
Inside that function
Find:
docookie($userinfo[user_id],$userinfo[username],$userinfo[user_password],$userinfo[storynum],$userinfo[umode],$userinfo[uorder],$userinfo[thold],$userinfo[noscore],$userinfo[ublockon],$userinfo[theme],$userinfo[commentmax]);
change to:
setcookie('theme',base64_encode($theme), 0);
docookie($userinfo[user_id],$userinfo[username],$userinfo[user_password],$userinfo[storynum],$userinfo[umode],$userinfo[uorder],$userinfo[thold],$userinfo[noscore],$userinfo[ublockon],$userinfo[theme],$userinfo[commentmax]);
##save and close file
##
##end
I am sure that must be some small chages to make because of the 7.8 patched but i don;t know.
If you need you can find the theme here http://www.fires-house.com/modules.php?name=Downloads&d_op=viewdownload&cid=15
Any help is really appreciated.
Thanks, |
|
|
|
 |
hitwalker
Sells PC To Pay For Divorce

Joined:
Posts: 5661
|
Posted:
Tue Sep 19, 2006 6:16 am |
|
Quote: | but i decided to have another php-nuke installation (7.8 patched 3.2b) in another directory |
and whats the address ? |
|
|
|
 |
shotokan

|
Posted:
Tue Sep 19, 2006 8:22 am |
|
I don't know how much different it makes on the code but yesterday I was told to where it says:
change to:
setcookie('theme',base64_encode($theme), 0);
docookie($userinfo[user_id],$userinfo[username],$userinfo[user_password],$userinfo[storynum],$userinfo[umode],$userinfo[uorder],$userinfo[thold],$userinfo[noscore],$userinfo[ublockon],$userinfo[theme],$userinfo[commentmax]);
To forget about changing the whole docookie as was requested into the install.txt but only add the setcookie part in front of it. I did that and it worked. |
|
|
|
 |
hitwalker

|
Posted:
Tue Sep 19, 2006 8:50 am |
|
|
|
 |
zutgorak
New Member


Joined: Jun 03, 2006
Posts: 5
|
Posted:
Wed Nov 22, 2006 4:19 am |
|
Im running 7.6 myself, and i cant seem to get this thing to work
most likely, im doing something stupid. but, heres what I did
I tried to follow the install instructions to the letter
first time around, and when i got it inside and all
documents saved, i cant do anything, because when I
do, my browser turns white.
Oh well, no biggie as the site isnt having anything else but themes
atm, but still, annoying.
I then found this thread, and tried again.
still no luck, same error.
What am I doing wrong? |
|
|
|
 |
zutgorak

|
Posted:
Sat Dec 09, 2006 4:21 pm |
|
Ok, so i got it to work on 7.6 but for some reason it doesnt display
a preview image of the theme .. any suggestions as to what im missing?
Addition .. changed to nuke 7.8
still getting the actual block to work,
but it still displays the "broken image" thing where the theme
preview is supposed to be. Now, correct me if im wrong, but isnt
there supposed to be a preview of the theme there?
If not, well, no biggie, ill just add a static image. But
still, i do hope  |
|
|
|
 |
shotokan

|
Posted:
Sat Dec 09, 2006 5:27 pm |
|
If you are using the theme preview by "viperal" there is not theme image preview to display. It will change the theme and that's it.
The little broken image you are talking about has nothing to do with the theme it is just a little image of the block itself. |
|
|
|
 |
|