Desktop Plus Mod -- Need some porting help

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   re: Desktop Plus Mod -- Need some porting help
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 60
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
That could very well be. I have another site which has several themes on it. I will try it there.

I wonder if there is a fix for this in the theme itself. It looks like stuff is just being placed above the header, instead of opening in a new window. If you will notice, the page acts like it is trying to access a restricted module, and the info is just being added to the top of the page.

I wonder If I will have to change themes in the future.




_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
#2   re: Desktop Plus Mod -- Need some porting help
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 60
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
Ok, JRSweets don't give up on me yet, please!

BTW This is on nuke 7.2

I have narrowed this down to the modules.php file. I don't know exactly where, so I am doing lots of searching. Here's what mine looks like. Anyone see any reason why the entire page would be called up?

?php

/************************************************************************/
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* 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.       */
/************************************************************************/

require_once("mainfile.php");
$module = 1;
$name = trim($name);

if (isset($name)) {
    global $nukeuser;
    $nukeuser = base64_decode($user);
    $sql = "SELECT active, view FROM ".$prefix."_modules WHERE title='$name'";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
    $mod_active = $row[active];
    $mod_active = intval(trim($mod_active));
    $view = $row[view];
    if (($mod_active == 1) OR ($mod_active == 0 AND is_admin($admin))) {
      if (!isset($mop)) { $mop="modload"; }
      if (!isset($file)) { $file="index"; }
      if (ereg("\.\.",$name) || ereg("\.\.",$file) || ereg("\.\.",$mop)) {
          echo "You are so cool...";
      } else {
          $ThemeSel = get_theme();
          if (file_exists("themes/$ThemeSel/modules/$name/$file.php")) {
            $modpath = "themes/$ThemeSel/";
          } else {
            $modpath = "";
          }
          if ($view == 0) {
            $modpath .= "modules/$name/$file.php";
             if (file_exists($modpath)) {
                include($modpath);
             } else {
                die ("Sorry, such file doesn't exist...");
            }
          }
          if ($view == 1 AND (is_user($user) OR is_group($user, $name) OR is_admin($admin))) {
            $modpath .= "modules/$name/$file.php";
             if (file_exists($modpath)) {
                include($modpath);
             } else {
                die ("Sorry, such file doesn't exist...");
            }
          } elseif ($view == 1 AND !is_user($user) AND !is_admin($admin)) {
            $pagetitle = "- "._ACCESSDENIED."";
            include("header.php");
            title("$sitename: "._ACCESSDENIED."");
            OpenTable();
            echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
                .""._MODULEUSERS."";
            $sql = "SELECT mod_group FROM ".$prefix."_modules WHERE title='$name'";
            $result = $db->sql_query($sql);
            $row = $db->sql_fetchrow($result);
            if ($row[mod_group != 0]) {
                $sql = "SELECT name FROM ".$prefix."_groups WHERE id='$row[mod_group]'";
                $result = $db->sql_query($sql);
                $row = $db->sql_fetchrow($result);
                echo ""._ADDITIONALYGRP.": <b>$row[name]</b><br><br>";
            }
            echo ""._GOBACK."";
            CloseTable();
            include("footer.php");
            die();
          }
          if ($view == 2 AND is_admin($admin)) {
            $modpath .= "modules/$name/$file.php";
             if (file_exists($modpath)) {
                include($modpath);
             } else {
                die ("Sorry, such file doesn't exist...");
            }
          } elseif ($view == 2 AND !is_admin($admin)) {
            $pagetitle = "- "._ACCESSDENIED."";
            include("header.php");
            title("$sitename: "._ACCESSDENIED."");
            OpenTable();
            echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
                .""._MODULESADMINS.""
                .""._GOBACK."";
            CloseTable();
            include("footer.php");
            die();
          }
          if ($view == 3 AND paid()) {
            $modpath .= "modules/$name/$file.php";
             if (file_exists($modpath)) {
                include($modpath);
             } else {
                die ("Sorry, such file doesn't exist...");
            }
          } else {
            $pagetitle = "- "._ACCESSDENIED."";
            include("header.php");
            title("$sitename: "._ACCESSDENIED."");
            OpenTable();
            echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
                .""._MODULESSUBSCRIBER."";
            if ($subscription_url != "") {
               echo "<br>"._SUBHERE."";
            }
            echo "<br><br>"._GOBACK."";
            CloseTable();
            include("footer.php");
            die();
          }
      }
    } else {
      include("header.php");
      OpenTable();
      echo "<center>"._MODULENOTACTIVE."<br><br>"
          .""._GOBACK."</center>";
      CloseTable();
      include("footer.php");
    }
} else {
    die ("Sorry, you can't access this file directly...");
}

?>


I am sure it has to do something with this part of the code:

} else {
            $pagetitle = "- "._ACCESSDENIED."";
            include("header.php");
            title("$sitename: "._ACCESSDENIED."");
            OpenTable();
            echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
                .""._MODULESSUBSCRIBER."";
            if ($subscription_url != "") {
               echo "<br>"._SUBHERE."";
            }
            echo "<br><br>"._GOBACK."";
            CloseTable();
            include("footer.php");
            die();


At lease that's what is being shown along with the desktop. This is also an issue with copermine when it displays a popup window. Fixing this may fix all of those issues.

Ok, I have done some checking and found this isn't a new problem. I just haven't found a solution as of yet. Here is another discussion on this:
[ Register or login to view links on this board. ]



_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
#3   re: Desktop Plus Mod -- Need some porting help
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 60
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
Hey! I think I fixed it. Here is the modules.php portion I changed:

}
          if ($view == 3 AND paid()) {
            $modpath .= "modules/$name/$file.php";
             if (file_exists($modpath)) {
                include($modpath);
             } else {
                die ("Sorry, such file doesn't exist...");
            }
          } elseif ($view == 3 AND !paid()) {
            $pagetitle = "- "._ACCESSDENIED."";
            include("header.php");
            title("$sitename: "._ACCESSDENIED."");
            OpenTable();
            echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
                .""._MODULESSUBSCRIBER."";
            if ($subscription_url != "") {
               echo "<br>"._SUBHERE."";
            }
            echo "<br><br>"._GOBACK."";
            CloseTable();
            include("footer.php");
            die();
          }


So far everything works out ok. I will see if all else works.



_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
#4   re: Desktop Plus Mod -- Need some porting help
CStingray78
CZ Super Newbie
CStingray78 has been a member for over 20 year's 20 Year Member
usa.gif maryland.gif
Occupation: IT Consultant
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Dec 24, 2003
0.01 posts per day
Posts: 58
Points: 4,878
AIM Address   
EDIT: Posted in wrong forum topic.



Back to top Reply with quote
#5   re: Desktop Plus Mod -- Need some porting help
CStingray78
CZ Super Newbie
CStingray78 has been a member for over 20 year's 20 Year Member
usa.gif maryland.gif
Occupation: IT Consultant
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Dec 24, 2003
0.01 posts per day
Posts: 58
Points: 4,878
AIM Address   
How would I add # of Private Messages to the desktop block so that it would show up for users?

Tom



Back to top Reply with quote
#6   re: Desktop Plus Mod -- Need some porting help
CStingray78
CZ Super Newbie
CStingray78 has been a member for over 20 year's 20 Year Member
usa.gif maryland.gif
Occupation: IT Consultant
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Dec 24, 2003
0.01 posts per day
Posts: 58
Points: 4,878
AIM Address   
I have fixed a few problems with the original Desktop Mod:

The META Refresh Tag was not updating for latest info, I used Javascript for refresh.
Added Read and Unread Private Messages to the List for viewers to see on their desktop.

I will gladly put up the changes if anyone is interested.

Tom



Back to top Reply with quote
#7   re: Desktop Plus Mod -- Need some porting help
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 60
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
Hey! Sounds like those would be a good add for it. Can you go ahead and post them. I would like to give it a try and see how it works.




_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
#8   re: Desktop Plus Mod -- Need some porting help
CStingray78
CZ Super Newbie
CStingray78 has been a member for over 20 year's 20 Year Member
usa.gif maryland.gif
Occupation: IT Consultant
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Dec 24, 2003
0.01 posts per day
Posts: 58
Points: 4,878
AIM Address   
OK, here goes... If it looks a little rough, please let me know. But, it does work!

Open modules/Forums/desktop.php
Find:
//
// End session management
//

Add After:
//
// Private Messages
//
if ($userdata['session_logged_in']) {
   $uid = $userdata['user_id'];
   $pms_unread = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')"));
   $pms_read = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
} else {
   $pms_unread = 'Login To View Messages';
   $pms_read = 'Login To View Messages';
}
//
// END - Private Messages
//

Near the end of that file, change:
$template->assign_vars(array(
   'LOGIN_STATUS_TITLE' => $login_status_title,
   'LOGIN_STATUS_EXPLAIN' => $login_status_explain,
   'L_RECENT_TOPICS' => $lang['Recent_topics'],
   'TOTAL_USERS_ONLINE' => $l_online_users,
   'LOGGED_IN_USER_LIST' => $online_userlist,
   'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),
   'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],
   'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
   'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'))
);

To This:
$template->assign_vars(array(
   'LOGIN_STATUS_TITLE' => $login_status_title,
   'LOGIN_STATUS_EXPLAIN' => $login_status_explain,
   'PM_TITLE' => '<a href=modules.php?name=Private_Messages>Private Messages</a>',
   'UNREAD_PM' => $pms_unread,
   'READ_PM' => $pms_read,
   'L_RECENT_TOPICS' => 'Recent Forum Topics',
   'TOTAL_USERS_ONLINE' => $l_online_users,
   'LOGGED_IN_USER_LIST' => $online_userlist,
   'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),
   'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],
   'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
   'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'))
);

Then, Open themes/YOURTHEME/forums/desktop_body.tpl
Find the first instance of:
<br class="gensmall" />

And add after that:
        <table width="200" cellpadding="2" cellspacing="1" border="0" class="forumline">
         <tr>
         <td class="catHead" height="25"><span class="genmed"><b>{PM_TITLE}</b></span></td>
         </tr>
         <tr>
         <td class="row1" height="25"><span class="gensmall">Unread: {UNREAD_PM}</span></td>
         </tr>
         <tr>
         <td class="row1" height="25"><span class="gensmall">Read: {READ_PM}</span></td>
         </tr>
         </table>

<br class="gensmall" />


I think thats it. If you see areas that need a little cleanup, let me know.

Tom



_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#9   re: Desktop Plus Mod -- Need some porting help
CStingray78
CZ Super Newbie
CStingray78 has been a member for over 20 year's 20 Year Member
usa.gif maryland.gif
Occupation: IT Consultant
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Dec 24, 2003
0.01 posts per day
Posts: 58
Points: 4,878
AIM Address   
Also, changed this to fix the Refresh Problem:

Open themes/phpib2/forums/desktop_body.tpl
Edit the top few lines to look like this:
<!-- <meta http-equiv="Refresh" content="60;url=http://www.YOURWEBSITE.com/modules.php?name=Forums&file=desktop"> -->
<link rel="stylesheet" href="modules/Forums/templates/subSilver/forums.css" type="text/css">
</head>
<BODY onLoad=window.setTimeout("location.href='http://www.YOURWEBSITE.com/modules.php?name=Forums&file=desktop'",60000)>



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum