Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account
Author Message
kabool
New Member
New Member



Joined: Mar 01, 2006
Posts: 2

PostPosted: Wed Mar 01, 2006 3:53 am Reply with quote

hello, I have install CNB your account 750 440beta2 with phpnuke 7.5 and when I want go to the link Create field in the user administration panel I have an error:

Code:
Parse error: parse error, unexpected T_PUBLIC, expecting ']' in c:\wamp\www\portail_test_705\html\modules\Your_Account\admin\addfield.php on line 54



In my addfield.php on line 54 I have that:

Code:
if ($sqlvalue[public] == '1') $sel = "selected"; else $sel = "";


what is the problem, all the rest of CNB your account work correctly.

thanks for your help...
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Mar 01, 2006 9:48 am Reply with quote

Try
Code:


if ($sqlvalue['public'] == '1') { $sel = "selected"; } else { $sel = ""; }

That should work. If you are still having problems, post more of the code around that line

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
kabool







PostPosted: Thu Mar 02, 2006 2:20 am Reply with quote

I have try your code, but I have an error:

Code:
Parse error: parse error, unexpected T_PUBLIC, expecting ']' in c:\wamp\www\portail_test_705\html\modules\Your_Account\admin\addfield.php on line 56



My code on addfield folder is:

Code:
<?php


/*********************************************************************************/
/* CNB Your Account: An Advanced User Management System for phpnuke             */
/* ============================================                                 */
/*                                                                              */
/* Copyright (c) 2004 by Comunidade PHP Nuke Brasil                             */
/* http://dev.phpnuke.org.br & http://www.phpnuke.org.br                        */
/*                                                                              */
/* Contact author: escudero@phpnuke.org.br                                      */
/* International Support Forum: http://ravenphpscripts.com/forum76.html         */
/*                                                                              */
/* 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.               */
/*                                                                              */
/*********************************************************************************/
/* CNB Your Account it the official successor of NSN Your Account by Bob Marion */
/*********************************************************************************/

if (!defined('YA_ADMIN')) { echo "CNBYA admin protection"; exit; }
if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
    header("Location: ../../../index.php");
    die ();
}if (!defined('CNBYA')) { echo "CNBYA protection"; exit; }
if (($radminsuper==1) OR ($radminuser==1)) {

    $pagetitle = ": "._USERADMIN." - "._ADDFILED;
    include("header.php");
    title(_USERADMIN." - "._ADDFIELD);
    amain();
    echo "<br>\n";
    OpenTable();
   
    echo "<center><table border='0'>\n";
    echo "<form action='modules.php?name=$module_name&file=admin' method='post'>\n";
    echo "<tr><td bgcolor='$bgcolor2'>ID</td><td bgcolor='$bgcolor2'>"._FIELDNAME."*</td><td bgcolor='$bgcolor2'>"._FIELDVALUE."**</td><td bgcolor='$bgcolor2'>"._FIELDSIZE."</td><td bgcolor='$bgcolor2'>"._FIELDNEED."</td><td bgcolor='$bgcolor2'>"._FIELDVPOS."</td><td bgcolor='$bgcolor2'>"._FIELDDEL."</td><td bgcolor='$bgcolor2'>"._YA_PUBLIC."</td></tr>\n";
    $result = $db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_field ORDER BY pos");
    while ($sqlvalue = $db->sql_fetchrow($result)) {
    $t = $sqlvalue[fid];
    echo "<tr><td bgcolor='$bgcolor2'>$sqlvalue[fid]</td><td bgcolor='$bgcolor2'><input type='text' name='field_name[$t]' value='$sqlvalue[name]' size='20' maxlength='20'></td><td bgcolor='$bgcolor2'><input type='text' name='field_value[$t]' value='$sqlvalue[value]' size='20' maxlength=$sqlvalue[size]></td><td bgcolor='$bgcolor2'><input type='text' name='field_size[$t]' value='$sqlvalue[size]' size='4' maxlength='4'></td><td bgcolor='$bgcolor2'>";
    echo "<select name='field_need[$t]'>\n";
        if ($sqlvalue[need] == 1) $sel = "selected"; else $sel = "";
    echo "<option value=1 $sel>"._NEED1."</option>\n";
        if ($sqlvalue[need] == 2) $sel = "selected"; else $sel = "";
    echo "<option value=2 $sel>"._NEED2."</option>\n";
        if ($sqlvalue[need] == 3) $sel = "selected"; else $sel = "";
    echo "<option value=3 $sel>"._NEED3."</option>\n";
        if ($sqlvalue[need] == 0) $sel = "selected"; else $sel = "";
    echo "<option value=0 $sel>"._NEED0."</option>\n";
    echo "</select>";
    echo "</td><td bgcolor='$bgcolor2'><input type='text' name='field_pos[$t]' value='$sqlvalue[pos]' size='3' maxlength='3'></td>\n";
    echo "<td bgcolor='$bgcolor2'><select name='field_public[$t]'>\n";
        if ($sqlvalue['public'] == '1') { $sel = "selected"; } else { $sel = ""; }
    echo "<option value=1 $sel>"._YA_PUBLIC."</option>\n";
        if ($sqlvalue[public] == '0') $sel = "selected"; else $sel = "";
    echo "<option value=0 $sel>"._YA_PRIVATE."</option>\n";
    echo "</select></td>\n";
    echo "<td bgcolor='$bgcolor2'><a href='modules.php?name=$module_name&file=admin&op=delField&fid=$t'>"._FIELDDEL."</a></td></tr>\n";
    }
    echo "<tr><td bgcolor='$bgcolor2'>&nbsp;</td><td bgcolor='$bgcolor2'><input type='text' name='mfield_name' size='20' maxlength='20'></td><td bgcolor='$bgcolor2'><input type='text' name='mfield_value' size='20' maxlength='255'></td><td bgcolor='$bgcolor2'><input type='text' name='mfield_size' size='4' maxlength='4'></td><td bgcolor='$bgcolor2'>";
    echo "<select name='mfield_need'>\n";
        echo "<option value='1' selected>"._NEED1."</option>\n";
        echo "<option value='2'>"._NEED2."</option>\n";
        echo "<option value='3'>"._NEED3."</option>\n";
        echo "<option value='0'>"._NEED0."</option>\n";
    echo "</select>";
    echo "</td><td bgcolor='$bgcolor2'><input type='text' name='mfield_pos' size=3 maxlength='3'></td>\n";
    echo "<td bgcolor='$bgcolor2'><select name='mfield__public'>\n";
        echo "<option value=1 selected>"._YA_PUBLIC."</option>\n";
        echo "<option value=0 >"._YA_PRIVATE."</option>\n";
    echo "</select></td>\n";
    echo "<td bgcolor='$bgcolor2'>&nbsp;</td></tr>\n";

    echo "<tr><td align='center' colspan='8'><br>";
        OpenTable();
        echo "</td><td align=\"center\">"._NAMECOMENT."<br>"._VALUECOMENT."</td><td>\n";
        CloseTable();
    echo "</td></tr><tr><td align='center' colspan='8'>";
    echo "<input type='submit' value='"._ADDFIELD."'>\n";
    echo "<input type='hidden' name='op' value='saveaddField'>\n";
    echo "</td></tr></form>\n";
//  echo "<form action='modules.php?name=$module_name&file=admin' method='post'>\n";
    echo "<tr><td align='center' colspan='8'><input type='submit' value='"._CANCEL."'></td></tr>\n";
    echo "</form>\n";
    echo "</table>\n";
    CloseTable();
    include("footer.php");

}

?>


thank for your help evaders99
 
montego
Site Admin



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

PostPosted: Thu Mar 02, 2006 5:27 am Reply with quote

Have you tried fixing line 56 to look like the code Evaders mentioned? You changed line 54, but 56 (where the error is now) looks like the same issue?

_________________
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
FireATST
RavenNuke(tm) Development Team



Joined: Jun 12, 2004
Posts: 654
Location: Ohio

PostPosted: Wed Jan 10, 2007 11:26 am Reply with quote

Since no response was made back on this, I will. It seems to have solved the problem for me when both lines are edited to include the changes evaders proposed....Smile
 
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account

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 ©