Hello!
Thank you so very much for your response. It was quite helpful. I hope you can help me again with the subsequent problems,
PROBLEM I
PREPARATION:
I did the following,
1 - I replaced the code with the code you suggested.
2 - I placed the "header.html" through a html to php code coverter.
3 - I placed "<?" and "?>" around the code that was coverted.
4 - I saved the new file as "header.php"
RESULT:
The header displayed OK
except the date on the right was not visible. Is there another way to include javascript in PHP code?
This is the snippet of code for the date presently in the theme,
Code:
echo ("<td width='150' nowrap><div align='center'><font class='content'>");
echo ("<script type='text/javascript'>");
echo ("<!-- // Array ofmonth Names");
echo ("var monthNames = new Array( 'January','February','March','April','May','June','July','August','September','October','November','December');");
echo ("var now = new Date();");
echo ("thisYear = now.getYear();");
echo ("if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem");
echo ("document.write(monthNames[now.getMonth()] + ' ' + now.getDate() + ', ' + thisYear);");
echo ("// -->");
echo ("</script>");
echo ("</font></div></td>");
PROBLEM II
SITUATION:
I am trying to get site members to login right below the "Create an Account" link in the left upper corner. I now have the login boxes displayed by using the "header.php" process noted above and not "header.html".
After the members sign in I would like the area to change to a "Private Messages" area and the login boxes disappear.
WHAT I DID:
I replaced the present script for the login boxes in "header.php" which displays with no problem,
Code:
echo ("<form action='modules.php?name=Your_Account' method='post'>");
echo ("<TD width='35%'>NICKNAME <input type='text' name='uname' size='10' maxlength='25'>");
echo ("PASSWORD <input type='password' name='pass' size='10' maxlength='20'>");
echo ("<input type='hidden' name='op' value='login'><input type='submit' value='LOGIN'>");
echo ("</td>");
echo ("</form>");
with the following code from the "User Block". I did not place echo infront of each line because this is PHP code (Is my reasoning correct??),
Code:
$result = sql_query("select uid from $user_prefix"._users." where uname='$username'", $dbi);
list($uid) = sql_fetch_row($result, $dbi);
$result2 = sql_query("select to_userid from $prefix"._priv_msgs." where to_userid='$uid' and read_msg='0'", $dbi);
$newpms = sql_num_rows($result2, $dbi);
$result3 = sql_query("select to_userid from $prefix"._priv_msgs." where to_userid='$uid' and read_msg='1'", $dbi);
$oldpms = sql_num_rows($result3, $dbi);
$content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\">"._BPM."</a>
\n";
$content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": $newpms
\n";
$content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": $oldpms
\n<hr>\n";
} else {
$content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", $anonymous\n<hr>";
$content .= ""._NICKNAME." <input type=\"text\" name=\"uname\" size=\"10\" maxlength=\"25\">
";
$content .= ""._PASSWORD." <input type=\"password\" name=\"pass\" size=\"10\" maxlength=\"20\">
";
$content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
$content .= "<input type=\"submit\" value=\""._LOGIN."\">\n (<a href=\"modules.php?name=Your_Account&op=new_user\">"._BREG."</a>)<hr>";
}
When I reload the page to check on it I get the following message [UserID is an example of the login name),
Code:
Parse error: parse error, unexpected '}' in /home/UserID/public_html/html/themes/subSystem/header.php on line 55
This is where the following line of code is located,
Given that the code in "header.html" has been coverted to PHP, how can I get the "login boxes" to disappear and the "Private Messages" area to appear after members login?
Thank you in advance for any an all help you can give me with these problems and situations.
WP1