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
shotokan
Worker
Worker


Joined: Aug 27, 2006
Posts: 172

PostPosted: Mon Sep 18, 2006 7:56 am Reply with quote

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 Only registered users can see links on this board! Get registered or login!

Any help is really appreciated.

Thanks,
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Tue Sep 19, 2006 6:16 am Reply with quote

Quote:
but i decided to have another php-nuke installation (7.8 patched 3.2b) in another directory


and whats the address ?
 
View user's profile Send private message
shotokan
PostPosted: Tue Sep 19, 2006 8:22 am Reply with quote

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
PostPosted: Tue Sep 19, 2006 8:50 am Reply with quote

nice.
 
zutgorak
New Member
New Member


Joined: Jun 03, 2006
Posts: 5

PostPosted: Wed Nov 22, 2006 4:19 am Reply with quote

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?
 
View user's profile Send private message
zutgorak
PostPosted: Sat Dec 09, 2006 4:21 pm Reply with quote

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 Smile
 
shotokan
PostPosted: Sat Dec 09, 2006 5:27 pm Reply with quote

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.
 
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 ©