| Author |
Message |
Agrivated
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10
|
Posted:
Thu Mar 23, 2006 10:56 pm |
  |
Every time i try to change the title of a block, it does not take affect.
using MySQL 5.0.19, Abyss Web Server x1 and PHP-NUKE 7.8 |
|
|
   |
 |
Evaders99
Site Admin


Joined: Aug 17, 2003
Posts: 12342
|
Posted:
Fri Mar 24, 2006 6:54 am |
  |
|
     |
 |
Agrivated
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10
|
Posted:
Fri Mar 24, 2006 7:07 am |
  |
patch for what, php-nuke, and where do i get it? |
|
|
   |
 |
Evaders99
Site Admin


Joined: Aug 17, 2003
Posts: 12342
|
Posted:
Fri Mar 24, 2006 7:08 am |
  |
|
     |
 |
Agrivated
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10
|
Posted:
Fri Mar 24, 2006 8:36 am |
  |
i didn't see any 3.2 patch but i did update using the 7.9 patch (running the update.php file) which is the actual version of php-nuke that i was using(not 7.8). That did not fix the problem though. |
|
|
   |
 |
Evaders99
Site Admin


Joined: Aug 17, 2003
Posts: 12342
|
Posted:
Fri Mar 24, 2006 8:43 pm |
  |
|
     |
 |
Agrivated
Nuke Soldier


Joined: Mar 24, 2006
Posts: 10
|
Posted:
Fri Mar 24, 2006 9:54 pm |
  |
i was using 7.9 not 7.8 and i downloaded the 7.9 patch.
yes it happens to all blocks. I can create blocks just fine but, when i try to edit the title, after creation, the change does not take affect either. |
|
|
   |
 |
rafaelgm
Nuke Cadet


Joined: Apr 10, 2006
Posts: 4
|
Posted:
Mon Apr 10, 2006 11:31 pm |
  |
Hi,
I figured out what the problem is while doing a few tests. The problem is that the value of the "refresh" field (integer) of "nuke_blocks" table is wrong in the SQL update command. I know nothing about PHP, but I will see if I can study it a little and try to discover the real cause of the problem. A temporary "ugly" fix would be editing this file:
..\htdocs\phpnuke\html\admin\modules\blocks.php
Look for the line that begins with:
$result8 = $db->sql_query
Before that line, add this, so it will look like:
$refresh = intval($refresh);
$result8 = $db->sql_query
It's crazy, I know! I was debugging it and If I put "echo $refresh", nothing appears, but if I put "echo intval($refresh);" the value appears! Hahaha, PHP is crazy! If someone can figure this out it would be very nice.
Please, excuse my english. |
Last edited by rafaelgm on Wed Apr 12, 2006 4:09 pm; edited 2 times in total |
|
   |
 |
rafaelgm
Nuke Cadet


Joined: Apr 10, 2006
Posts: 4
|
Posted:
Tue Apr 11, 2006 5:10 pm |
  |
Hi again,
I'm sorry, my solution was very ugly! It just "bypassed" the problem!
The problem lies in function BlocksEdit in this section of the [...]/html/admin/modules/blocks.php file:
| Code: |
...
."<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> <font class=\"tiny\">"._ONLYHEADLINES."</font>";
}
... |
That if does not have an else. I mean, if the url variable is empty, the value of the refresh value is not being converted to HTML code. And when the BlocksEditSave function is called, this value is empty.
The solution is to add an else to the if, passing the refresh value as an "hidden input type" to the HTML code, like this:
| Code: |
...
if ($url != "") {
...
}
else
echo "<input type=\"hidden\" name=\"refresh\" value=\"$refresh\">";
... |
But maybe this value is not useful at all if the url variable is empty. Then, it could be set to 0. But as I don't know that, I just leave the value the way it is. |
|
|
   |
 |
Evaders99
Site Admin


Joined: Aug 17, 2003
Posts: 12342
|
Posted:
Tue Apr 11, 2006 6:10 pm |
  |
|
     |
 |
rafaelgm
Nuke Cadet


Joined: Apr 10, 2006
Posts: 4
|
Posted:
Wed Apr 12, 2006 4:13 pm |
  |
| Evaders99 wrote: |
| It is only used for RSS feed, so I think you should be safe setting it blank or 0. |
Thanks for the reply. Yeah, if the value is only used for that, it is safe to set it to 0. I think it has to be zero because the table field is an integer. And that was the original problem: the field was blank, so PHP converted it to an empty string ('') and tried to insert that value into the database. |
|
|
   |
 |
|
|