PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
kevinkap
Involved
Involved


Joined: Apr 22, 2006
Posts: 352

PostPosted: Sat Oct 27, 2007 7:00 pm Reply with quote Back to top

running rn2.10.01 with cnbya4.4.2 modified by fade2gray from here. I have found the code that is missing in the cnbya file that will make it show any subscriptions you have but cannot get it to work.

Mod please move if you feel it would be better in another thread.

I have compared the code, here is the section that the cnbya file is missing.

Code:

       echo _USERSTATUS.': <b>'.$online.'</b><br />'."\n";
        if (($userinfo['newsletter'] == 1) AND (isset($cookie[1]) AND $username == $cookie[1]) AND (isset($cookie[2]) AND $userinfo['user_password'] == $cookie[2]) OR (is_admin($admin) AND ($userinfo['newsletter'] == 1))) {
            echo '<i>'._SUBSCRIBED.'</i><br />';
        } elseif (isset($cookie[1]) AND ($userinfo['newsletter'] == 0) AND ($username == $cookie[1]) AND (isset($cookie[2]) AND $userinfo['user_password'] == $cookie[2]) OR (is_admin($admin) AND ($userinfo['newsletter'] == 0))) {
            echo '<i>'._NOTSUBSCRIBED.'</i><br />';
        }
        if (is_user($user) AND $cookie[1] == "$username" OR is_admin($admin)) {
            $numpoints = $db->sql_fetchrow($db->sql_query('SELECT points FROM '.$user_prefix.'_users WHERE user_id = \''.intval($cookie[0]).'\''));
            $n_points = intval($numpoints['points']);
            echo _YOUHAVEPOINTS.' <b>'.$n_points.'</b><br />';
Code:

            if (paid()) {
                $row = $db->sql_fetchrow($db->sql_query('SELECT * FROM '.$prefix.'_subscriptions WHERE userid=\''.intval($cookie[0]).'\''));
                if (!empty($subscription_url)) {
                    $content = '<br />'._YOUARE.' <a href="'.$subscription_url.'">'._SUBSCRIBER.'</a> '._OF." $sitename".'<br />';
                } else {
                    $content = '<br />'._YOUARE.' '._SUBSCRIBER.' '._OF." $sitename".'<br />';
                }
                $diff = $row['subscription_expire']-time();
                $yearDiff = floor($diff/60/60/24/365);
                $diff -= $yearDiff*60*60*24*365;
                if ($yearDiff < 1) {
                    $diff = $row['subscription_expire']-time();
                }
                $daysDiff = floor($diff/60/60/24);
                $diff -= $daysDiff*60*60*24;
                $hrsDiff = floor($diff/60/60);
                $diff -= $hrsDiff*60*60;
                $minsDiff = floor($diff/60);
                $diff -= $minsDiff*60;
                $secsDiff = $diff;
                if ($yearDiff < 1) {
                    $rest = $daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                } elseif ($yearDiff == 1) {
                    $rest = $yearDiff.' '._SBYEAR.', '.$daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                } elseif ($yearDiff > 1) {
                    $rest = $yearDiff.' '._SBYEARS.', '.$daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                }
                $content .= '<b>'._SUBEXPIREIN.'</b><br /><font color="#FF0000"><b>'.$rest.'</b></font>';
            } else {
                if (!empty($subscription_url)) {
                    $content .= '<br />'._NOTSUB." $sitename. "._SUBFROM.' <a href="'.$subscription_url.'">'._HERE.'</a> '._NOW;
                } else {
                    $content .= '<br />'._NOTSUB." $sitename.";
                }
            }
echo "$content".'<br /><br />';
            if (is_admin($admin)) {
                $subnum = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_subscriptions WHERE userid=\''.intval($userinfo['user_id']).'\''));
                if ($subnum != 0) {
                    echo '<b>'._ADMSUB.'</b><br />';
                    $row = $db->sql_fetchrow($db->sql_query('SELECT * FROM '.$prefix.'_subscriptions WHERE userid=\''.intval($userinfo['user_id']).'\''));
                    $diff = $row['subscription_expire']-time();
                    $yearDiff = floor($diff/60/60/24/365);
                    $diff -= $yearDiff*60*60*24*365;
                    if ($yearDiff < 1) {
                        $diff = $row['subscription_expire']-time();
                    }
                    $daysDiff = floor($diff/60/60/24);
                    $diff -= $daysDiff*60*60*24;
                    $hrsDiff = floor($diff/60/60);
                    $diff -= $hrsDiff*60*60;
                    $minsDiff = floor($diff/60);
                    $diff -= $minsDiff*60;
                    $secsDiff = $diff;
                    if ($yearDiff < 1) {
                        $rest = $daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                    } elseif ($yearDiff == 1) {
                        $rest = $yearDiff.' '._SBYEAR.', '.$daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                    } elseif ($yearDiff > 1) {
                        $rest = $yearDiff.' '._SBYEARS.', '.$daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                    }
                    $content = '<b>'._ADMSUBEXPIREIN.'</b><br /><font color="#FF0000"><b>'.$rest.'</b></font><br /><br />';
                    echo "$content";
                } else {
                    echo '<b>'._ADMNOTSUB.'</b><br /><br />';
                }
            }
        }


You can see the points code is a bit different as well.

I believe the code goes after this:
Code:

                if (is_user($user) AND $cookie[1] == "$username" OR is_admin($admin)) {
                    echo "<tr>\n<td width='30%' bgcolor='$bgcolor1'>"._YA_POINTS."</td>\n<td width='70%' bgcolor='$bgcolor1'><b>$usrinfo[points]</b></td>\n</tr>\n";
                }
            }
            if (($usrinfo[newsletter] == 1) AND ($username == $cookie[1]) AND ($usrinfo[user_password] == $cookie[2]) OR (is_admin($admin) AND ($usrinfo[newsletter] == 1))) {
                echo "<tr>\n<td width='30%' bgcolor='$bgcolor1'>"._NEWSLETTER."</td>\n<td width='70%' bgcolor='$bgcolor1'><b>"._SUBSCRIBED."</b></td>\n</tr>\n";
            } elseif (($usrinfo[newsletter] == 0) AND ($username == $cookie[1]) AND ($usrinfo[user_password] == $cookie[2]) OR (is_admin($admin) AND ($usrinfo[newsletter] == 0))) {
                echo "<tr>\n<td width='30%' bgcolor='$bgcolor1'>"._NEWSLETTER."</td>\n<td width='70%' bgcolor='$bgcolor1'><b>"._NOTSUBSCRIBED."</b></td>\n</tr>\n";
            }


I have tried putting it in there but get a white page after I do. Any help is as always much appreciated Wink
View user's profile Send private message
kevinkap
Involved
Involved


Joined: Apr 22, 2006
Posts: 352

PostPosted: Sat Oct 27, 2007 7:53 pm Reply with quote Back to top

ok, I have figured it out. If anyone is using rn2.10.01 and cnbya4.4.2 you will need to make the following changes to the ya/public/userinfo.php file for it to show your subscriptions, points and group memberships.

After this on line 119

Code:
echo "<tr>\n<td width='30%' bgcolor='$bgcolor1'>"._YA_POINTS."</td>\n<td width='70%' bgcolor='$bgcolor1'><b>$usrinfo[points]</b></td>\n</tr>\n";


remove everything down to this:
Code:
echo "</table>\n";
            echo "</center><br>\n<center>\n";
            if (is_active("Journal") AND $cookie[1] != $username) {


now add this after line 119:
Code:
   }
            }
if (($userinfo['newsletter'] == 1) AND (isset($cookie[1]) AND $username == $cookie[1]) AND (isset($cookie[2]) AND $userinfo['user_password'] == $cookie[2]) OR (is_admin($admin) AND ($userinfo['newsletter'] == 1))) {
            echo '<i>'._SUBSCRIBED.'</i><br />';
        } elseif (isset($cookie[1]) AND ($userinfo['newsletter'] == 0) AND ($username == $cookie[1]) AND (isset($cookie[2]) AND $userinfo['user_password'] == $cookie[2]) OR (is_admin($admin) AND ($userinfo['newsletter'] == 0))) {
            echo '<i>'._NOTSUBSCRIBED.'</i><br />';
        }
        if (is_user($user) AND $cookie[1] == "$username" OR is_admin($admin)) {
            $numpoints = $db->sql_fetchrow($db->sql_query('SELECT points FROM '.$user_prefix.'_users WHERE user_id = \''.intval($cookie[0]).'\''));
            $n_points = intval($numpoints['points']);
            echo _YOUHAVEPOINTS.' <b>'.$n_points.'</b><br />';
            if (paid()) {
                $row = $db->sql_fetchrow($db->sql_query('SELECT * FROM '.$prefix.'_subscriptions WHERE userid=\''.intval($cookie[0]).'\''));
                if (!empty($subscription_url)) {
                    $content = '<br />'._YOUARE.' <a href="'.$subscription_url.'">'._SUBSCRIBER.'</a> '._OF." $sitename".'<br />';
                } else {
                    $content = '<br />'._YOUARE.' '._SUBSCRIBER.' '._OF." $sitename".'<br />';
                }
                $diff = $row['subscription_expire']-time();
                $yearDiff = floor($diff/60/60/24/365);
                $diff -= $yearDiff*60*60*24*365;
                if ($yearDiff < 1) {
                    $diff = $row['subscription_expire']-time();
                }
                $daysDiff = floor($diff/60/60/24);
                $diff -= $daysDiff*60*60*24;
                $hrsDiff = floor($diff/60/60);
                $diff -= $hrsDiff*60*60;
                $minsDiff = floor($diff/60);
                $diff -= $minsDiff*60;
                $secsDiff = $diff;
                if ($yearDiff < 1) {
                    $rest = $daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                } elseif ($yearDiff == 1) {
                    $rest = $yearDiff.' '._SBYEAR.', '.$daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                } elseif ($yearDiff > 1) {
                    $rest = $yearDiff.' '._SBYEARS.', '.$daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                }
                $content .= '<b>'._SUBEXPIREIN.'</b><br /><font color="#FF0000"><b>'.$rest.'</b></font>';
            } else {
                if (!empty($subscription_url)) {
                    $content .= '<br />'._NOTSUB." $sitename. "._SUBFROM.' <a href="'.$subscription_url.'">'._HERE.'</a> '._NOW;
                } else {
                    $content .= '<br />'._NOTSUB." $sitename.";
                }
            }
            echo "$content".'<br /><br />';
            if (is_admin($admin)) {
                $subnum = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_subscriptions WHERE userid=\''.intval($userinfo['user_id']).'\''));
                if ($subnum != 0) {
                    echo '<b>'._ADMSUB.'</b><br />';
                    $row = $db->sql_fetchrow($db->sql_query('SELECT * FROM '.$prefix.'_subscriptions WHERE userid=\''.intval($userinfo['user_id']).'\''));
                    $diff = $row['subscription_expire']-time();
                    $yearDiff = floor($diff/60/60/24/365);
                    $diff -= $yearDiff*60*60*24*365;
                    if ($yearDiff < 1) {
                        $diff = $row['subscription_expire']-time();
                    }
                    $daysDiff = floor($diff/60/60/24);
                    $diff -= $daysDiff*60*60*24;
                    $hrsDiff = floor($diff/60/60);
                    $diff -= $hrsDiff*60*60;
                    $minsDiff = floor($diff/60);
                    $diff -= $minsDiff*60;
                    $secsDiff = $diff;
                    if ($yearDiff < 1) {
                        $rest = $daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                    } elseif ($yearDiff == 1) {
                        $rest = $yearDiff.' '._SBYEAR.', '.$daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                    } elseif ($yearDiff > 1) {
                        $rest = $yearDiff.' '._SBYEARS.', '.$daysDiff.' '._SBDAYS.', '.$hrsDiff.' '._SBHOURS.', '.$minsDiff.' '._SBMINUTES.', '.$secsDiff.' '._SBSECONDS;
                    }
                    $content = '<b>'._ADMSUBEXPIREIN.'</b><br /><font color="#FF0000"><b>'.$rest.'</b></font><br /><br />';
                    echo "$content";
                } else {
                    echo '<b>'._ADMNOTSUB.'</b><br /><br />';
                }
            }
        }


Then after the "close table" around line 225:
Code:
 if (((is_user($user) AND $cookie[1] != $username) OR is_admin($admin)) AND is_active("Private_Messages")) { echo "<br>[ <a href=\"messages-.html$usrinfo[user_id]\">"._USENDPRIVATEMSG." $usrinfo[username]</a> ]<br>\n"; }
            echo "</center></font>";
        } else {
            echo "<center>"._NOINFOFOR." $username</center>";
        }
        CloseTable();


you will need to add this code:

Code:
   //2006-03-09 montego: fix so group memberships only show to the logged in user and admin br#0000005
    if ((is_user($user) AND $cookie[1] == $username) OR is_admin($admin)) {
        // Group Memberships
        // Add these to your Your_Account lang files:
        //define('_MEMBERGROUPS','Group Memberships');
        //define('_EXPIRES','expires');
        //define('_NOTSET','non-expiring');
        $result11 = $db->sql_query('SELECT gid, edate FROM '.$prefix.'_nsngr_users WHERE uid=\''.$userinfo['user_id'].'\' ORDER BY gid');
        if (($db->sql_numrows($result11) > 0)) {
            if($userinfo['user_dateformat']=='') { $userinfo['user_dateformat'] = grget_config(date_format); }
            echo '<br />';
            OpenTable();
            echo '<b>'.$userinfo['username'].'\'s '._MEMBERGROUPS.':</b><br />'."\n";
            echo '<ul>';
            while(list($gid, $edate) = $db->sql_fetchrow($result11)) {
                list($gname) = $db->sql_fetchrow($db->sql_query('SELECT gname FROM '.$prefix.'_nsngr_groups WHERE gid=\''.intval($gid).'\''));
                echo '<li>'."$gname";
                if (is_admin($admin)) { echo " ($gid)"; }
                if ($edate != '') {
                    if ($edate != 0) {
                        echo '&nbsp;&nbsp;- <i>'._EXPIRES.' '.date($userinfo['user_dateformat'], $edate).'</i>';
                    } else {
                        echo '&nbsp;&nbsp;- <i>'._NOTSET.'</i>';
                    }
                }
                echo '</li>'."\n";
            }
            echo '</ul>';
            CloseTable();
        }
    }


Now I am sure this post probably needs to be moved but I hope it helps someone.
View user's profile Send private message
montego
Former Admin in Good Standing


Joined: Aug 29, 2004
Posts: 9071
Location: Arizona

PostPosted: Sat Oct 27, 2007 9:18 pm Reply with quote Back to top

I have made it a sticky. It may need to be moved to CNBYA forum (or copied), but lets see what the "reaction" is to your thread from the community...
View user's profile Send private message Visit poster's website
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

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

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum