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 -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro
Author Message
benson
Worker
Worker


Joined: May 15, 2004
Posts: 119
Location: Germany

PostPosted: Sun Apr 16, 2006 1:45 pm Reply with quote

Hello Raven,

I am not sure that it was already reported, but I do have 2 problems with the last version:

1. Your_Account is not translated completely, I mean the part regarding the avatar settings is hardcoded and therefor difficult to translate into german (e.g. if updates are to be included).

2. The admin modul for blocks settings has a bug. It shows 'left' all the times I change a block and if I miss to change it back to right or center the block will be changed to the left side ...

Hope you have that already found out and fixed for the next release that will be published on monday Smile

Thanks for the good work !!!

Regards, Norbert

_________________
Best regards, Norbert

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
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Sun Apr 16, 2006 2:08 pm Reply with quote

I wouldn't like to comment whether or not there would be time to address these two issues before the release - at the end of the day we HAVE to draw a line somewhere BUT if you can point me to the file that holds the hard coded literals for the avatar setting I can at least ensure it gets added to our bug tracker.

Left block setting is shown 'left' by default as the file responsible just grabs the list of installed block files from the database and inserts a 'default' value and does not actually check to see if a value is set and what that value is. Nuke has always done this but none the less, it might be useful to populate the list with the current DB data, rather than just presenting the user with a list. I will add this to bug tracker as an enhancement request.
 
View user's profile Send private message Send e-mail
benson
PostPosted: Sun Apr 16, 2006 2:21 pm Reply with quote

Hello,

the hard coded part is in modules/Your_Account/index.php, around line 1154 ff.

Regarding the blocks admin, it's not so often that I change my blocks settings, but I thank you for the 'enhancement request'.

The main problem I have is that if I change it by my own, I always have to do it again if I install a new (patched/bugfixed) version. E.g. the News module, I always have to add the code I have to get a page count and a 'next' / 'previous' button on the bottom of each page ...
 
Guardian2003
PostPosted: Sun Apr 16, 2006 2:42 pm Reply with quote

benson - thank you for that information. I will look at the file and get these added to our bug tracker.
 
Guardian2003
PostPosted: Sun Apr 16, 2006 3:02 pm Reply with quote

Addendum: I was wrong. The block *list* should show all the current blocks with their current settings, it is only when you go into the EDIT mode for a specific block that the issue arises - added to bug tracker as an enhancement request.
 
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Sun Apr 16, 2006 5:53 pm Reply with quote

Just to add to this, I am running both a RN 2.02.02 test system and a Nuke 7.6 production system (with 3.1 patches, Sentinel 2.4something). In the test system this bug (the blocks showing as being in the wrong place in edit mode) this problem occurs but when I went back to the production system they show up in the right place. I should say the "correct" place to avoid confusion.

I mention this just in case, during the process of satisfying the enhancement request, we can track back to any changes that took place and reverse those that caused a problem. Or perhaps just running a file comparison utility will work, I'll take a look at that early this week.
 
View user's profile Send private message Visit poster's website
fkelly
PostPosted: Sun Apr 16, 2006 6:10 pm Reply with quote

Let me get a life !!!

From Nuke 7.6 here is the code in blocks.php that correctly displays the position of the blocks:

Code:
   $oldposition = $bposition;

    echo "<input type=\"hidden\" name=\"oldposition\" value=\"$oldposition\">";
    $sel1 = $sel2 = $sel3 = $sel4 = "";
    if ($bposition == "l") {
   $sel1 = "selected";
    } elseif ($bposition == "c") {
   $sel2 = "selected";
    } elseif ($bposition == "r") {
   $sel3 = "selected";
    } elseif ($bposition == "d") {
   $sel4 = "selected";
    }
    echo "<tr><td>"._POSITION.":</td><td><select name=\"bposition\">"
   ."<option name=\"bposition\" value=\"l\" $sel1>"._LEFT."</option>"
   ."<option name=\"bposition\" value=\"c\" $sel2>"._CENTERUP."</option>"
   ."<option name=\"bposition\" value=\"d\" $sel4>"._CENTERDOWN."</option>"
   ."<option name=\"bposition\" value=\"r\" $sel3>"._RIGHT."</option></select></td></tr>";


Here is the screwed up code from RN 2.02 that displays the block in the wrong place:

Code:
    $oldposition = $bposition;

    echo "<input type=\"hidden\" name=\"oldposition\" value=\"$oldposition\">";
    $sel1 = $sel2 = $sel3 = $sel4 = $sel5 = "";
    if ($view == 0) {
   $sel1 = "selected";
    } elseif ($view == 1) {
   $sel2 = "selected";
    } elseif ($view == 2) {
   $sel3 = "selected";
    } elseif ($view == 3) {
   $sel4 = "selected";
    } elseif ($view > 3) {
   $sel5 = "selected";
    }
    echo "<tr><td>"._POSITION.":</td><td><select name=\"bposition\">"
   ."<option name=\"bposition\" value=\"l\" $sel1>"._LEFT."</option>"
   ."<option name=\"bposition\" value=\"c\" $sel2>"._CENTERUP."</option>"
   ."<option name=\"bposition\" value=\"d\" $sel4>"._CENTERDOWN."</option>"
   ."<option name=\"bposition\" value=\"r\" $sel3>"._RIGHT."</option></select></td></tr>";


This code occurs in the BlocksEdit function after the blocks table has been read and field values have been stuffed into variables.

From my work with "A theme without tables" I know that bposition is the field in the blocks table that sets the position of each block and it can have one of four values: r, l, c, or d. I'm not sure what the use of the view field is. I don't know and can't imagine why the view field is introduced in this context but I've been surprised before. I really don't want to step in and try to modify this for a release that's taking place in a day or two but we can surely try reverting to portions of the old code for a bug fix. It would be helpful to determine who made the changes first and why. There may be a good reason that I'm not seeing.

Please excuse my substituting "field" for "column"; I'm a pre-relational man.
 
Guardian2003
PostPosted: Sun Apr 16, 2006 7:58 pm Reply with quote

Owing to the use of $sel5 I think this looks like 'groups' code and yes, from that extract I don't see how $view comes into play. I will try and take a more indepth look as soon as time allows.
 
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Mon Apr 17, 2006 2:00 am Reply with quote

fkelly, is 'screwed up code' a fair assessment to say? It seems that it could have been stated as Here is the code that isn't working from ...
 
View user's profile Send private message
fkelly
PostPosted: Mon Apr 17, 2006 6:24 am Reply with quote

"fkelly, is 'screwed up code' a fair assessment to say? It seems that it could have been stated as Here is the code that isn't working from ..."

Of course you are right Raven! That is exactly what I meant to say and somehow my fingers hit those other keys. It was late at night and yada yada ...

Incidentally, this morning I replaced the "code that doesn't work" with the old code as shown in my previous post and tested it on a RN 2.02 system. It does work.
 
whitebox
Regular
Regular


Joined: Nov 22, 2004
Posts: 52

PostPosted: Mon Apr 17, 2006 7:49 am Reply with quote

since you tested it and it works fine and after replacing the "not working code" with the "old one" did you test NSN Groups ?
do you still get the option to pick what nsn group can see what block and if you can did you made sure that is realy working that way ??
just my two cent...
 
View user's profile Send private message Visit poster's website
blith
Client


Joined: Jul 18, 2003
Posts: 977

PostPosted: Mon Apr 17, 2006 8:12 am Reply with quote

Raven wrote:
fkelly, is 'screwed up code' a fair assessment to say? It seems that it could have been stated as Here is the code that isn't working from ...


Hear hear, there is a lot of stuff going on in all the releases and the updates and I for one am amazed at how you guys do this and keep it all straight. Thanks for the hard work and the quick work to fix any code that is not working properly...
 
View user's profile Send private message Visit poster's website
benson
PostPosted: Mon Apr 17, 2006 8:31 am Reply with quote

Huuuuuuuuuuuuuuu,
I thought I just had two small 'bugs' that I wanted to be fixed in the next release ...
I didn't want to delay the release I am waiting for so long Smile
 
Guardian2003
PostPosted: Mon Apr 17, 2006 8:38 am Reply with quote

One things for sure - it couldn't have happened without the help of this fantastic community here!
Even though we have a very good QA Team kicking the code from here to next week and a Development Team putting the pieces back together again, there will probably always be something that gets missed (Murphys Law) but thanks to this community and the feedback they provide,we can certainly minimise the 'Murphys Law' affect.

benson - index.php has been fixed for the up coming release and language file updated - thank you once again for bring this to our attention.
 
Raven
PostPosted: Mon Apr 17, 2006 9:20 am Reply with quote

If you use the old code you will break the admin/blocks.php code, so it's not just a matter of using the old one. We'll look into this before we release v2.02.02.
 
fkelly
PostPosted: Mon Apr 17, 2006 10:44 am Reply with quote

With regard to Whitebox's comment about groups, that is why I wrote previously:

Quote:
I don't know and can't imagine why the view field is introduced in this context but I've been surprised before. I really don't want to step in and try to modify this for a release that's taking place in a day or two but we can surely try reverting to portions of the old code for a bug fix. It would be helpful to determine who made the changes first and why. There may be a good reason that I'm not seeing.


I have never used groups before I installed RN2.02 for testing. I'm trying it out now and I don't see any problems having it work with the "old" code. There is code in blocks.php down below the changes I made that deals with what groups can see what blocks (at least that's how I'm reading it). But, yes we'd be a lot safer if someone who was familiar with how this code "evolved" got involved or at the very least if someone who has RN2.02 installed and who is familiar with using groups to control who sees what blocks could test my suggested changes.
 
CodyG
Life Cycles Becoming CPU Cycles


Joined: Jan 02, 2003
Posts: 712
Location: Vancouver Island

PostPosted: Mon Apr 17, 2006 11:00 am Reply with quote

I'm no expert, but here are my two cents... in version 6.9 with an **earlier** NSN Groups mod, the code looks like the following. *And* the behaviour of defaulting to selected Left, when attempting a simple edit, does not exist.


Code:


$oldposition = $bposition;
    echo "<input type=\"hidden\" name=\"oldposition\" value=\"$oldposition\">";
    if ($bposition == "l") {
        $sel1 = "selected";
        $sel2 = "";
        $sel3 = "";
        $sel4 = "";
    } elseif ($bposition == "c") {
        $sel1 = "";
        $sel2 = "selected";
        $sel3 = "";
        $sel4 = "";
    } elseif ($bposition == "r") {
        $sel1 = "";
        $sel2 = "";
        $sel3 = "selected";
        $sel4 = "";
    } elseif ($bposition == "d") {
        $sel1 = "";
        $sel2 = "";
        $sel3 = "";
        $sel4 = "selected";
    }
    echo "<tr><td>"._POSITION.":</td><td><select name=\"bposition\">"
        ."<option name=\"bposition\" value=\"l\" $sel1>"._LEFT."</option>"
        ."<option name=\"bposition\" value=\"c\" $sel2>"._CENTERUP."</option>"
        ."<option name=\"bposition\" value=\"d\" $sel4>"._CENTERDOWN."</option>"
        ."<option name=\"bposition\" value=\"r\" $sel3>"._RIGHT."</option></select></td></tr>";



$view was introduced in a later version of NSN Groups?

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
fkelly
PostPosted: Mon Apr 17, 2006 11:16 am Reply with quote

I think you are right CodyG and Whitebox and Raven were right too. The $view does pertain to groups and the code fix I made does break the "interface" between groups and the blocks.php. However;

1. The code I suggested does work for the bposition and should be retained for that purpose.

2. Down below that in the RN2.02 blocks.php there is code which currently reads:

Code:
    $sel1 = $sel2 = $sel3 = $sel4 = "";

    if ($view == 0) {
   $sel1 = "selected";
    } elseif ($view == 1) {
   $sel2 = "selected";
    } elseif ($view == 2) {
   $sel3 = "selected";
    } elseif ($view == 3) {
   $sel4 = "selected";
    }
    if ($subscription == 1) {
       $sub_c1 = "";
       $sub_c2 = "checked";
    } else {
       $sub_c1 = "checked";
       $sub_c2 = "";
    }
    echo "</td></tr><tr><td>"._VIEWPRIV."</td><td><select name=\"view\">"
        ."<option value=\"0\" $sel1>"._MVALL."</option>"
        ."<option value=\"1\" $sel2>"._MVUSERS."</option>"
        ."<option value=\"2\" $sel3>"._MVADMIN."</option>"
        ."<option value=\"3\" $sel4>"._MVANON."</option>"
        ."<option value=\"4\" $sel5>"._MVGROUPS."</option>"
        ."</select></td></tr><tr><td nowrap>"
        ."<b>"._WHATGROUPS."</b></td><td><font class='tiny'>"._WHATGRDESC."</font><br><select name='groups[]' multiple size='5'>";


The problem with that is that only $sel1 thru 4 are initialized and set. We really need to add $sel 5 to this and if $view is greater than 3 then set the option value with sel5 to selected. Here's code that does this.

Code:
    $sel1 = $sel2 = $sel3 = $sel4 = $sel5 = "";

    if ($view == 0) {
   $sel1 = "selected";
    } elseif ($view == 1) {
   $sel2 = "selected";
    } elseif ($view == 2) {
   $sel3 = "selected";
    } elseif ($view == 3) {
      $sel4 = "selected";
   } elseif ($view > 3) {
      $sel5 = "selected";
    }
    if ($subscription == 1) {
       $sub_c1 = "";
       $sub_c2 = "checked";
    } else {
       $sub_c1 = "checked";
       $sub_c2 = "";
    }
    echo "</td></tr><tr><td>"._VIEWPRIV."</td><td><select name=\"view\">"
        ."<option value=\"0\" $sel1>"._MVALL."</option>"
        ."<option value=\"1\" $sel2>"._MVUSERS."</option>"
        ."<option value=\"2\" $sel3>"._MVADMIN."</option>"
        ."<option value=\"3\" $sel4>"._MVANON."</option>"
        ."<option value=\"4\" $sel5>"._MVGROUPS."</option>"
        ."</select></td></tr><tr><td nowrap>"
        ."<b>"._WHATGROUPS."</b></td><td><font class='tiny'>"._WHATGRDESC."</font><br><select name='groups[]' multiple size='5'>";


I have tested this briefly on my RN 2.02 system and it appears to work but if someone else with a more complex groups set up could test it that would help a lot.

For what it's worth and from what I can determine the relationship between the value of the view field and what shows up should be:

view = 0 = mvall
view = 1 = mvusers
view = 2 = mvadmin
view = 3 = mvanon
view = 4 = mvgroups
 
CodyG
PostPosted: Mon Apr 17, 2006 11:51 am Reply with quote

I'll check my copy/paste again, but that didn't work for me ... for just one click into EditBlock I found a right block defaulting to centerup, then everything started defaulting back to left. If what you mean by complex group setup, I have 3 public or private groups.
 
fkelly
PostPosted: Mon Apr 17, 2006 12:09 pm Reply with quote

Well then, I'll post the whole BlocksEdit function as I now have it and maybe you can try that, just in case the copy paste wound up in the wrong spot. You are trying this on RN2.02?

Code:
function BlocksEdit($bid) {

    global $bgcolor2, $bgcolor4, $prefix, $db, $multilingual, $admin_file;
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class=\"title\"><b>"._EDITBLOCK."</b></font></center>";
    CloseTable();
    echo "<br>";
    $bid = intval($bid);
    $row = $db->sql_fetchrow($db->sql_query("select * from ".$prefix."_blocks where bid='$bid'"));
    $groups = $row['groups'];
    $bkey = $row['bkey'];
    $title = $row['title'];
    $content = $row['content'];
    $url = $row['url'];
    $bposition = $row['bposition'];
    $weight = intval($row['weight']);
    $active = intval($row['active']);
    $refresh = intval($row['refresh']);
    $blanguage = $row['blanguage'];
    $blockfile = $row['blockfile'];
    $view = intval($row['view']);
    $expire = intval($row['expire']);
    $action = intval($row['action']);
    $subscription = intval($row['subscription']);
    if ($url != "") {
   $type = _RSSCONTENT;
    } elseif ($blockfile != "") {
   $type = _BLOCKFILE;
    }
    OpenTable();
    echo "<center><font class=\"option\"><b>"._BLOCK.": $title $type</b></font></center><br><br>"
        ."<form action=\"".$admin_file.".php\" method=\"post\">"
        ."<table border=\"0\" width=\"100%\">"
        ."<tr><td>"._TITLE.":</td><td><input type=\"text\" name=\"title\" size=\"30\" maxlength=\"60\" value=\"$title\"></td></tr>";
    if ($blockfile != "") {
   echo "<tr><td>"._FILENAME.":</td><td>"
       ."<select name=\"blockfile\">";
   $blocksdir = dir("blocks");
   while($func=$blocksdir->read()) {
       if(substr($func, 0, 6) == "block-") {
          $blockslist .= "$func ";
       }
   }
   closedir($blocksdir->handle);
   $blockslist = explode(" ", $blockslist);
   sort($blockslist);
   for ($i=0; $i < sizeof($blockslist); $i++) {
       if($blockslist[$i]!="") {
      $bl = ereg_replace("block-","",$blockslist[$i]);
      $bl = ereg_replace(".php","",$bl);
      $bl = ereg_replace("_"," ",$bl);
      echo "<option value=\"$blockslist[$i]\" ";
      if ($blockfile == $blockslist[$i]) { echo "selected"; }
      echo ">$bl</option>\n";
       }
   }
   echo "</select>&nbsp;&nbsp;<font class=\"tiny\">"._FILEINCLUDE."</font></td></tr>";
    } else {
   if ($url != "") {
       echo "<tr><td>"._RSSFILE.":</td><td><input type=\"text\" name=\"url\" size=\"30\" maxlength=\"200\" value=\"$url\">&nbsp;&nbsp;<font class=\"tiny\">"._ONLYHEADLINES."</font></td></tr>";
   } else {
       echo "<tr><td>"._CONTENT.":</td><td>";
#       <textarea name=\"content\" cols=\"50\" rows=\"10\">$content</textarea>
      wysiwyg_textarea("content", "$content", "PHPNukeAdmin", "50", "10");
      echo "</td></tr>";
   }
    }
    $oldposition = $bposition;
    echo "<input type=\"hidden\" name=\"oldposition\" value=\"$oldposition\">";
    $sel1 = $sel2 = $sel3 = $sel4 = "";
    if ($bposition == "l") {
   $sel1 = "selected";
    } elseif ($bposition == "c") {
   $sel2 = "selected";
    } elseif ($bposition == "r") {
   $sel3 = "selected";
    } elseif ($bposition == "d") {
   $sel4 = "selected";
    }
    echo "<tr><td>"._POSITION.":</td><td><select name=\"bposition\">"
   ."<option name=\"bposition\" value=\"l\" $sel1>"._LEFT."</option>"
   ."<option name=\"bposition\" value=\"c\" $sel2>"._CENTERUP."</option>"
   ."<option name=\"bposition\" value=\"d\" $sel4>"._CENTERDOWN."</option>"
   ."<option name=\"bposition\" value=\"r\" $sel3>"._RIGHT."</option></select></td></tr>";
    if ($multilingual == 1) {
   echo "<tr><td>"._LANGUAGE.":</td><td>"
       ."<select name=\"blanguage\">";
   $handle=opendir('language');
   while ($file = readdir($handle)) {
       if (preg_match("/^lang\-(.+)\.php/", $file, $matches)) {
           $langFound = $matches[1];
           $languageslist .= "$langFound ";
       }
   }
   closedir($handle);
   $languageslist = explode(" ", $languageslist);
   sort($languageslist);
   for ($i=0; $i < sizeof($languageslist); $i++) {
       if($languageslist[$i]!="") {
      echo "<option value=\"$languageslist[$i]\" ";
      if($languageslist[$i]==$blanguage) echo "selected";
      echo ">".ucfirst($languageslist[$i])."</option>\n";
       }
   }
   if ($blanguage != "") {
       $sel3 = "";
   } else {
       $sel3 = "selected";
   }
   echo "<option value=\"\" $sel3>"._ALL."</option></select></td></tr>";
    } else {
   echo "<input type=\"hidden\" name=\"blanguage\" value=\"\">";
    }
    if ($active == 1) {
   $sel1 = "checked";
   $sel2 = "";
    } elseif ($active == 0) {
   $sel1 = "";
   $sel2 = "checked";
    }
    if ($expire != 0) {
        $oldexpire = $expire;
        $expire = intval(($expire - time()) / 3600);
        $exp_day = $expire / 24;
        $expire = "<input type=\"hidden\" name=\"expire\" value=\"$oldexpire\"><b>$expire "._HOURS." (".substr($exp_day,0,5)." "._DAYS.")</b>";
    } else {
        $expire = "<input type=\"text\" name=\"expire\" value=\"0\" size=\"4\" maxlength=\"3\"> "._DAYS."";
    }
    if ($action == "d") {
        $selact1 = "selected";
        $selact2 = "";
    } elseif ($action == "r") {
        $selact1 = "";
        $selact2 = "selected";
    }
    echo "<tr><td>"._ACTIVATE2."</td><td><input type=\"radio\" name=\"active\" value=\"1\" $sel1>"._YES." &nbsp;&nbsp;"
        ."<input type=\"radio\" name=\"active\" value=\"0\" $sel2>"._NO."</td></tr>"
        ."<tr><td>"._EXPIRATION.":</td><td>$expire</td></tr>"
        ."<tr><td>"._AFTEREXPIRATION.":</td><td><select name=\"action\">"
        ."<option name=\"action\" value=\"d\" $selact1>"._DEACTIVATE."</option>"
        ."<option name=\"action\" value=\"r\" $selact2>"._DELETE."</option></select></td></tr>";
    if ($url != "") {
    $sel1 = $sel2 = $sel3 = $sel4 = $sel5 = "";
    if ($refresh == 1800) {
   $sel1 = "selected";
    } elseif ($refresh == 3600) {
   $sel2 = "selected";
    } elseif ($refresh == 18000) {
   $sel3 = "selected";
    } elseif ($refresh == 36000) {
   $sel4 = "selected";
    } elseif ($refresh == 86400) {
   $sel5 = "selected";
    }
    echo "<tr><td>"._REFRESHTIME.":</td><td><select name=\"refresh\"><option name=\"refresh\" value=\"1800\" $sel1>1/2 "._HOUR."</option>"
        ."<option name=\"refresh\" value=\"3600\" $sel2>1 "._HOUR."</option>"
        ."<option name=\"refresh\" value=\"18000\" $sel3>5 "._HOURS."</option>"
        ."<option name=\"refresh\" value=\"36000\" $sel4>10 "._HOURS."</option>"
        ."<option name=\"refresh\" value=\"86400\" $sel5>24 "._HOURS."</option></select>&nbsp;<font class=\"tiny\">"._ONLYHEADLINES."</font>";
    }
    $sel1 = $sel2 = $sel3 = $sel4 = $sel5 = "";
    if ($view == 0) {
   $sel1 = "selected";
    } elseif ($view == 1) {
   $sel2 = "selected";
    } elseif ($view == 2) {
   $sel3 = "selected";
    } elseif ($view == 3) {
      $sel4 = "selected";
   } elseif ($view > 3) {
      $sel5 = "selected";
    }
    if ($subscription == 1) {
       $sub_c1 = "";
       $sub_c2 = "checked";
    } else {
       $sub_c1 = "checked";
       $sub_c2 = "";
    }
    echo "</td></tr><tr><td>"._VIEWPRIV."</td><td><select name=\"view\">"
        ."<option value=\"0\" $sel1>"._MVALL."</option>"
        ."<option value=\"1\" $sel2>"._MVUSERS."</option>"
        ."<option value=\"2\" $sel3>"._MVADMIN."</option>"
        ."<option value=\"3\" $sel4>"._MVANON."</option>"
        ."<option value=\"4\" $sel5>"._MVGROUPS."</option>"
        ."</select></td></tr><tr><td nowrap>"
        ."<b>"._WHATGROUPS."</b></td><td><font class='tiny'>"._WHATGRDESC."</font><br><select name='groups[]' multiple size='5'>";
    $ingroups = explode("-",$groups);
    $groupsResult = $db->sql_query("select gid, gname from ".$prefix."_nsngr_groups");
    while(list($gid, $gname) = $db->sql_fetchrow($groupsResult)) {
        if(in_array($gid,$ingroups)) { $sel = " selected"; } else { $sel = ""; }
        echo "<OPTION VALUE='$gid'$sel>$gname</option>";
    }
    echo "</select></td></tr><tr><td nowrap>"
        .""._SUBVISIBLE."</td><td><input type='radio' name='subscription' value='0' $sub_c1> "._YES."&nbsp;&nbsp;<input type='radio' name='subscription' value='1' $sub_c2> "._NO.""
      ."</td></tr></table><br><br>"
      ."<input type=\"hidden\" name=\"bid\" value=\"$bid\">"
      ."<input type=\"hidden\" name=\"bkey\" value=\"$bkey\">"
      ."<input type=\"hidden\" name=\"weight\" value=\"$weight\">"
        ."<input type=\"hidden\" name=\"op\" value=\"BlocksEditSave\">"
        ."<input type=\"submit\" value=\""._SAVEBLOCK."\"></form>";
    CloseTable();
    include("footer.php");
}


On my RN system I just switched the "big story of today" block from right to left. Edited it and it showed in the correct place on the edit screen. Switched it back to right. Edited it again. Still okay. Assigned it to a group ("test"). Edited it again, and it showed up only under that group. Flip flopped it back and forth between sides again too. All this looks okay using the code listed above.
 
Guardian2003
PostPosted: Mon Apr 17, 2006 12:19 pm Reply with quote

I still cannot get my head around this one.
To my mind there should be two seperate distinct if/else loops - one for the view ($view) permission and one for the ($bposition) block position as this code just seems to be used for populating a form ready for user input to change any desired setting from whatever is held in the DB and saving that data back to the DB.

Perhaps I have completely lost the plot and am not reading it correctly!
 
CodyG
PostPosted: Mon Apr 17, 2006 2:17 pm Reply with quote

Thanks for the entire function... and yes, my copy/paste was screwy. I tried your code and the EditBlock position default is now working! It doesn't seem to destroy the group functions either, but I'll have to test this out a bit more.

And yes, I'm working on a RN 2.02
 
fkelly
PostPosted: Mon Apr 17, 2006 2:55 pm Reply with quote

Yeah Codyg! I am relieved.

Guardian ... you are exactly right but that's what there now is (two sections of code). The one for position starts at line 525 with the line:
Code:
 $oldposition = $bposition;


The one for view starts at line 618 (in my revised code) with the line:
Code:
   $sel1 = $sel2 = $sel3 = $sel4 = $sel5 = "";


The problem, I think reading this archeologically, is that the $view variable was used in the block position part of the logic instead of using the $bposition variable. I suspect this happened when the groups logic was put in here. But you are perfectly right, these are separate and distinct blocks of logic that do separate things.
 
Guardian2003
PostPosted: Mon Apr 17, 2006 3:00 pm Reply with quote

I was just looking at the whole code - yes that does seem more logical.
Pretty relieved now that I have not completely lost the plot Smile
 
Raven
PostPosted: Mon Apr 17, 2006 3:26 pm Reply with quote

Guardian2003, If you are ok with the code would you please make the changes, commit them and update Mantis? Thanks!
 
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 -> Raven's RavenNuke(tm) v2.00.00 - v2.02.00 Distro

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 ©