Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 52
4 members and 48 guests
bea9qgchcomberc, peardir46, ral6qkeighqenpa, whyjjinternetvi
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > NM Staff > Purged Topics

Reply
 
LinkBack Thread Tools Display Modes
Trying to add login line etc... to subSystem
Old
  (#1 (permalink))
WP1
Junior Member
 
Status: Offline
Posts: 16
Join Date: Feb 2003
Location: USA
Trying to add login line etc... to subSystem - 03-07-2003, 04:06 PM

I am trying to customize the subSystem theme for my site.

I would like to get the theme header to do the following,
- Place the login boxes to just under the "Create an Account" (to the left)
- Place the the site slogan to go just under the page links (to the center)
- Place the site search box for topics just under the date. (to the right)

When some one logs in I would like to get the login text box area to disappear and a "Private Messages" area to appear with the number of Unread and Read messages.

I know there is a user block that does this but I have not been able to get the code to work in the theme.php. as you can tell my PHP experience is limited.

I just cannot figure it out.

Any advice on how to accomplish this would be helpful.


Webbing Along!!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
03-07-2003, 06:08 PM

Not an easy task.

First of all. The onformaiton you are wanting to add would go into the header.html.
However, the header.html won't support the php scripts. So, you would be better off converting the header.html to a header.php file(php) Then you could add the appropriate php code for your loggin and search features.

Definately no easy like I said. But definately possible.

mikem
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
WP1
Junior Member
 
Status: Offline
Posts: 16
Join Date: Feb 2003
Location: USA
03-08-2003, 01:46 PM

Thanks! I will try it and see.

WP1


Webbing Along!!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
WP1
Junior Member
 
Status: Offline
Posts: 16
Join Date: Feb 2003
Location: USA
03-08-2003, 03:03 PM

Hello!,

Where would I change header.html to header.php so the changes would display?

Thanks in advance for your response.

WP1


Webbing Along!!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#5 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
03-08-2003, 09:19 PM

You don't just change the header.html fiel to header.php
You have to convert it to a php file
If you do not know how to convert a html file to php then ummm..ewww.

mikem
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#6 (permalink))
WP1
Junior Member
 
Status: Offline
Posts: 16
Join Date: Feb 2003
Location: USA
03-09-2003, 09:18 PM

Hello!,

I understand that part of the process. I was referring to - in which files I needed to change "header.html" to "header.php" so the script will be called correctly and display.

Thanks again for your help with this matter.

WP1


Webbing Along!!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#7 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
03-09-2003, 10:10 PM

Ahh ok I see what you are saying. The theme.php calls the header.html file.
So you would need to open theme.php and

change this
Code:
    $tmpl_file = "themes/subBlack/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    blocks(left);
    $tmpl_file = "themes/subBlack/left_center.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
to this
Code:
    include("themes/subBlack/header.php");
    blocks(left);
    $tmpl_file = "themes/subBlack/left_center.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
I used subBlack as a reference theme in the example above. But it gives you the necessary info I'm sure.

mikem
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#8 (permalink))
WP1
Junior Member
 
Status: Offline
Posts: 16
Join Date: Feb 2003
Location: USA
03-11-2003, 03:40 PM

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,
Code:
} else {
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


Webbing Along!!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#9 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
03-11-2003, 08:56 PM

Problem1: Open a theme that ONLY uses a theme.php file. Look in some of the Nuke default themes for this. Take the Date code from another theme and use it in your new header.php file. I had the same problem. My javascript date code got messed up somehow and I simply copied the "same" code from another theme.php and used it.

Problem2: I'll have to look at it closer, but I don't have that much time. You are on the right track.
A good idea for you would be to download our User Info block and look at it's code on how it does the loggin process. You might find exactly what you are looking for with the PM's showing after a user logs in :wink:

mikem
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#10 (permalink))
WP1
Junior Member
 
Status: Offline
Posts: 16
Join Date: Feb 2003
Location: USA
03-11-2003, 09:40 PM

Thanks for your response. I know it was a lot to look at.

I will try to do what you suggested above.

I will let you know what happened.

WP1


Webbing Along!!
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Line 45 PhPNewbie Nuke 7.x - General 2 02-21-2005 01:58 PM
Stack overflow at line: 526 iphoenix Site design 1 06-04-2003 06:25 PM
sql_layer.php on line 286 ERROR Virus Imp Nuke 6.5 to 6.9 - Blocks 0 04-04-2003 06:07 PM
Can login to PHP-Nuke, but won't transfer login to phpbb2 ehsanix Purged Topics 7 02-06-2003 09:20 AM
includes/sql_layer.php on line 301 IACOJ Open topics 7 01-08-2003 10:39 AM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31