Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.10.01 - All Issues
Author Message
kevinkap
Involved
Involved



Joined: Apr 22, 2006
Posts: 356

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

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

_________________
Kevin Kappes 
View user's profile Send private message
kevinkap







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

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.
 
montego
Site Admin



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

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

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

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
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.    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.10.01 - All Issues

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 ©