<?php
$result = mysql_query("SHOW COLUMNS FROM {$db_prefix}messages_options");
if (mysql_num_rows($result) > 0) {
echo "<table class='tbl-border'>\n<td colspan='2'><b>messages_options Table Scheme</b></td>\n";
while ($row = mysql_fetch_array($result)) {
echo "<tr><td class='tbl1'>".$row[0]."</td><td class='tbl2'>".$row[1]."</td></tr>\n";
}
echo "</table>\n";
}
?>
messages_options Table Scheme
user_id smallint(5) unsigned
pm_email_notify tinyint(1) unsigned
pm_save_sent tinyint(1) unsigned
pm_inbox smallint(5) unsigned
pm_savebox smallint(5) unsigned
pm_sentbox smallint(5) unsigned
Quote
WEC_Admin wrote:
Seems like your database table should be ok.
What happens when you hit save settings? Are you redirected to index page or is just nothing happening?
Quote
Does your browser show the ending of the url like this?:
administration/settings_messages.php?aid=bdec48d96292ae78
Quote
Are other settings in the admin panel not saved either or is it only in the PM settings page?
Quote
You could try to upload a fresh copy of settings_messages.php and see if it changes anything.
<?php
$data = dbquery("UPDATE ".$db_prefix."messages_options SET
pm_email_notify = '1',
pm_save_sent = '0',
pm_inbox = '20',
pm_sentbox = '20',
pm_savebox = '20'
WHERE user_id='0'"
);
echo "PM settings updated";
?>
Quote
WEC_Admin wrote:
Try to preview this in a custom page and then check if the PM settings are updated in your settings_messages.php:Code Download source<?php
$data = dbquery("UPDATE ".$db_prefix."messages_options SET
pm_email_notify = '1',
pm_save_sent = '0',
pm_inbox = '20',
pm_sentbox = '20',
pm_savebox = '20'
WHERE user_id='0'"
);
echo "PM settings updated";
?>
Quote
WEC_Admin wrote:
That's a new problem you introduce. Let's try to fix the original one first.
When you go to administration/settings_messages.php do you now see figures 20, 20, 20 in inbox, outbox and archive limit?
<?php
opentable("Table Structure");
$result = mysql_query("SHOW COLUMNS FROM {$db_prefix}messages_options");
if (mysql_num_rows($result) > 0) {
echo "<table cellspacing='1' cellpadding='0' class='tbl-border'>\n<td colspan='2' class='tbl2'><b>messages_options Table Scheme</b></td>\n";
while ($row = mysql_fetch_array($result)) {
echo "<tr><td class='tbl1'>".$row[0]."</td><td class='tbl2'>".$row[1]."</td></tr>\n";
}
echo "</table>\n";
}
closetable();
?>
Quote
Digitanium wrote:
Lets see if the table structure is ok, paste this into custom pages, preview it, tell us what you seeCode Download source<?php
opentable("Table Structure");
$result = mysql_query("SHOW COLUMNS FROM {$db_prefix}messages_options");
if (mysql_num_rows($result) > 0) {
echo "<table cellspacing='1' cellpadding='0' class='tbl-border'>\n<td colspan='2' class='tbl2'><b>messages_options Table Scheme</b></td>\n";
while ($row = mysql_fetch_array($result)) {
echo "<tr><td class='tbl1'>".$row[0]."</td><td class='tbl2'>".$row[1]."</td></tr>\n";
}
echo "</table>\n";
}
closetable();
?>
messages_options Table Scheme
user_id smallint(5) unsigned
pm_email_notify tinyint(1) unsigned
pm_save_sent tinyint(1) unsigned
pm_inbox smallint(5) unsigned
pm_savebox smallint(5) unsigned
pm_sentbox smallint(5) unsigned
<?php
$data = dbquery("UPDATE ".$db_prefix."messages_options SET
pm_email_notify = '1',
pm_save_sent = '0',
pm_inbox = '20',
pm_sentbox = '20',
pm_savebox = '20'
WHERE user_id='0'"
) [color=red]or die(mysql_error())[/color];
echo "PM settings updated";
?>
Quote
kejonn wrote:
Try WEC_Admins code again in custom pages but this time with a little addition:Code Download source<?php
$data = dbquery("UPDATE ".$db_prefix."messages_options SET
pm_email_notify = '1',
pm_save_sent = '0',
pm_inbox = '20',
pm_sentbox = '20',
pm_savebox = '20'
WHERE user_id='0'"
) [color=red]or die(mysql_error())[/color];
echo "PM settings updated";
?>
The additional code is in red. This tells the script to halt and throw a mysql error. It apears you have some type of issue with mysql. That's just a guess but worth a shot.
<?php
echo "Rows with user_id 0 = ".dbcount("(*)","messages_options","user_id='0'");
?>
<?php
$result = dbquery("SELECT * FROM ".$db_prefix."messages_options");
if (dbrows($result) > 0) {
while ($row=dbarray($result)) {
echo "User id: ".$row['user_id']."<br>";
}
}
else echo "message_options is empty";
?>
Quote
Digitanium wrote:
Run this and see what you get:Code Download source<?php
echo "Rows with user_id 0 = ".dbcount("(*)","messages_options","user_id='0'");
?>
Rows with user_id 0 = 0
<?php
$result = dbquery("INSERT INTO ".$db_prefix."messages_options (user_id, pm_email_notify, pm_save_sent, pm_inbox, pm_savebox, pm_sentbox) VALUES ('0', '0', '1', '20', '20', '20')");
echo "messages_options defaults restored";
?>
Category Forum
Bugs and Errors - 6Labels
None yet
Statistics
0 participants
Notifications
You are not receiving notifications from this thread.
Related Questions