Mam taki skrypt który wyświetla mi na stronie czy użytkownik jest zalogowany, jeśli nie jest pokazuje link do logowania a jeśli jest zalogowany pokazuje skrócone menu , o to on
<?php $GLOBALS["USER"] = $PHORUM["user"]; } else { // wrap all this in a function to protect it and other code function check_session() { // one of these needs to be commented out. $require = "sessid_lt"; // long term cookie that will exist over time //$require = "sessid_st"; // short term cookie that may not be required at all, but is more secure include_once($_SERVER["DOCUMENT_ROOT"]."/czarneplyty_strona/forum/include/db/config.php"); $conn=mysql_connect($PHORUM["DBCONFIG"]["server"], $PHORUM["DBCONFIG"]["user"], $PHORUM["DBCONFIG"]["password"], true); $sql="select * from ".$PHORUM["DBCONFIG"]["table_prefix"]."_users where user_id='".mysql_escape_string($user_id)."' and $require='".mysql_escape_string($sess_id)."'"; $sql="select data from ".$PHORUM["DBCONFIG"]["table_prefix"]."_settings where name='PROFILE_FIELDS'"; $sql="select * from ".$PHORUM["DBCONFIG"]["table_prefix"]."_user_custom_fields where user_id='".mysql_escape_string($user_id)."'"; $USER[$fields[$row["type"]]["name"]]=$row["data"]; } } } } else { } $GLOBALS["USER"]=$USER; } check_session(); } } } else { } ?>
Chciałbym aby w tym skróconym menu pojawiała się ikona która inforumje użytkownika czy mamy nową wiadomość , problem polega na tym , że nie wiem jak pogodzić skrypt ( ten u góry ) z tym kodem :
<?php $PHORUM['user']['new_private_messages'] = phorum_db_pm_checknew($PHORUM['user']['user_id']); } } ?>
Jeśli ktoś by mógł mi pomóc byłbym bardzo wdzięczny.