| Autor |
Zpráva |
Bekso
Svobodník


Registrace: 22.4. 2007
Příspěvky: 14
|
 Zaslal:
ne 22. duben, 2007 20:13 Předmět: Login headri |
  |
no blassene moc diki za ten navodik ale mne to nejak nefunguje ten kod som dal do theme.php a potom do header.html som dal $bwlogin a nezobrazuje sa mi nic |
|
|
| Návrat nahoru |
|
 |
Inzerce
Sponsor


Registrace: 4.1. 2007 Příspěvky: 143
|
|
 |
Blassen
Armádní generál (Admin)


Registrace: 1.1. 1970
Příspěvky: 2127
|
 Zaslal:
po 23. duben, 2007 19:49 Předmět: Re: Login v headri |
  |
1/ Kód do theme.php
2/ pak do funkce header()
a) pro vzhled s html soubory: $bwlogin = bw_login();
b) pro vzhled bez html souborů: bw_login();
3/ pro vzhled s html soubory: $bwlogin
pokud to nefunguje a zároveň to nehlásí chybu, vyzkoušejte ještě přidat do globals ještě: $bwlogin |
_________________ Blassen,
Altruista, Redaktor, Programátor, Designér a Majitel
Hello IT. Have you tried turning it off and on again ? Are you sure it's plugged in ? |
|
| Návrat nahoru |
|
 |
Bekso
Svobodník


Registrace: 22.4. 2007
Příspěvky: 14
|
 Zaslal:
po 23. duben, 2007 21:41 Předmět: |
  |
to $bwlogin = bw_login(); moezm vlozit hockde do Function themeheader() ? |
|
|
| Návrat nahoru |
|
 |
Blassen
Armádní generál (Admin)


Registrace: 1.1. 1970
Příspěvky: 2127
|
 Zaslal:
po 23. duben, 2007 21:47 Předmět: |
  |
Bekso napsal:
to $bwlogin = bw_login(); moezm vlozit hockde do Function themeheader() ?
Osobně když jsem to zkoušel jsem to dal pod $showbanners |
_________________ Blassen,
Altruista, Redaktor, Programátor, Designér a Majitel
Hello IT. Have you tried turning it off and on again ? Are you sure it's plugged in ? |
|
| Návrat nahoru |
|
 |
Blassen
Armádní generál (Admin)


Registrace: 1.1. 1970
Příspěvky: 2127
|
 Zaslal:
po 23. duben, 2007 21:52 Předmět: |
  |
Příklad na vzhledu iCGstation
theme.php
{Kód}:   include("themes/iCGstation/tables.php");
 
 /************************************************************/
 /* Function bw_login() */
 /* */
 /************************************************************/
 function bw_login() {
 global $admin, $user, $sitekey, $gfx_chk, $cookie;
 
 mt_srand ((double)microtime()*1000000);
 $maxran = 1000000;
 $random_num = mt_rand(0, $maxran);
 $datekey = date("F j");
 $rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $sitekey . $random_num . $datekey));
 $code = substr($rcode, 2, 6);
 
 $bwlogin_text = "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
 $bwlogin_text .= _NICKNAME.": ";
 $bwlogin_text .= "<input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\" /> ";
 $bwlogin_text .= _PASSWORD.": ";
 $bwlogin_text .= "<input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\" /> ";
 if (extension_loaded("gd") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
 $bwlogin_text .= _SECURITYCODE.": <img src=\"?gfx=gfx&random_num=".$random_num."\" border=\"1\" style=\"width: 77px; height: 20px\" alt=\""._SECURITYCODE."\" title=\""._SECURITYCODE."\" /> \n";
 $bwlogin_text .= "Opsat: <input type=\"text\" name=\"gfx_check\" size=\"7\" maxlength=\"6\" />\n";
 $bwlogin_text .= "<input type=\"hidden\" name=\"random_num\" value=\"".$random_num."\" />\n";
 } else {
 $bwlogin_text .= "<input type=\"hidden\" name=\"random_num\" value=\"".$random_num."\" />";
 $bwlogin_text .= "<input type=\"hidden\" name=\"gfx_check\" value=\"".$code."\" />";
 }
 $bwlogin_text .= "<input type=\"hidden\" name=\"op\" value=\"login\" />";
 $bwlogin_text .= " <input type=\"submit\" value=\""._LOGIN."\" /></form>";
 
 if (is_user($user)) {
 cookiedecode($user);
 $username = $cookie[1];
 $bwlogin_text = _WELCOMEBACKU." : <strong>$username</strong> ! [ <a href=\"modules.php?name=Your_Account\"><strong>"._ACCOUNT."</strong></a> | <a href=\"modules.php?name=Your_Account&op=logout\"><strong>"._ODHLASIT."</strong></a> ]";
 }
 return $bwlogin_text;
 }
 // 1/ pouziti:
 // $bwlogin = bw_login();
 // echo $bwlogin;
 
 // 2/ pouziti:
 // bw_login();
 
 
 /************************************************************/
 /* Function themeheader() */
 /* */
 /* Control the header for your site. You need to define the */
 /* BODY tag and in some part of the code call the blocks */
 /* function for left side with: blocks(left); */
 /************************************************************/
 
 function themeheader() {
 global $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $nukeurl, $anonymous, $showbanners;
 
 cookiedecode($user);
 $username = $cookie[1];
 if ($username == "") {
 $username = "Anonymous";
 }
 
 $showbanners = ads(0);
 $bwlogin = bw_login();
 echo "<body bgcolor=\"#FFFFFF\" text=\"#000000\">";

 if ($username == "Anonymous") {
 $theuser = " <a href=\"modules.php?name=Your_Account\">"._LOGIN."</a> or <a href=\"modules.php?name=Your_Account&op=new_user\">"._BREG."</a>";
 } else {
 $theuser = " "._BWEL." $username!";
 }

 $datetime = "<script type=\"text/javascript\">\n\n"
 ."<!-- // Array ofmonth Names\n"
 ."var monthNames = new Array( \""._JANUARY."\",\""._FEBRUARY."\",\""._MARCH."\",\""._APRIL."\",\""._MAY."\",\""._JUNE."\",\""._JULY."\",\""._AUGUST."\",\""._SEPTEMBER."\",\""._OCTOBER."\",\""._NOVEMBER."\",\""._DECEMBER."\");\n"
 ."var now = new Date();\n"
 ."thisYear = now.getYear();\n"
 ."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
 ."document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n"
 ."// -->\n\n"
 ."</script>";

 $public_msg = public_message();
 $tmpl_file = "themes/iCGstation/header.html";
 $thefile = implode("", file($tmpl_file));
 $thefile = addslashes($thefile);
 $thefile = "\$r_file=\"".$thefile."\";";
 eval($thefile);
 print $r_file;
 blocks(left);
 $tmpl_file = "themes/iCGstation/left_center.html";
 $thefile = implode("", file($tmpl_file));
 $thefile = addslashes($thefile);
 $thefile = "\$r_file=\"".$thefile."\";";
 eval($thefile);
 print $r_file;
 }
header.html
|
_________________ Blassen,
Altruista, Redaktor, Programátor, Designér a Majitel
Hello IT. Have you tried turning it off and on again ? Are you sure it's plugged in ? |
|
| Návrat nahoru |
|
 |
Bekso
Svobodník


Registrace: 22.4. 2007
Příspěvky: 14
|
 Zaslal:
po 23. duben, 2007 22:04 Předmět: |
  |
|
| Návrat nahoru |
|
 |
Blassen
Armádní generál (Admin)


Registrace: 1.1. 1970
Příspěvky: 2127
|
 Zaslal:
po 23. duben, 2007 22:19 Předmět: |
  |
Bekso napsal:
Přesunte ten
{Kód}:  $bwlogin = bw_login();
nad:
{Kód}:  echo "<body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n";
protože tak jak je umístěněj momentálně, tak je na místě kde se čtou bannery. Prostě tak jak jste to umístil to být nesmí.
Nesmí to být mezi jinými složenými závorkami {}
|
_________________ Blassen,
Altruista, Redaktor, Programátor, Designér a Majitel
Hello IT. Have you tried turning it off and on again ? Are you sure it's plugged in ? |
|
| Návrat nahoru |
|
 |
Inzerce
Sponsor


Registrace: 4.1. 2007 Příspěvky: 143
|
|
 |
Bekso
Svobodník


Registrace: 22.4. 2007
Příspěvky: 14
|
 Zaslal:
út 24. duben, 2007 15:46 Předmět: |
  |
thx very much uz to slape este si to poprekladam aby to zobrazovalo v slovnecine a bude to este az dik |
|
|
| Návrat nahoru |
|
 |
Blassen
Armádní generál (Admin)


Registrace: 1.1. 1970
Příspěvky: 2127
|
 Zaslal:
st 25. duben, 2007 23:04 Předmět: login header v slovnecine |
  |
Bekso napsal:
thx very much uz to slape este si to poprekladam aby to zobrazovalo v slovnecine a bude to este az dik
To nebylo automaticky ? |
_________________ Blassen,
Altruista, Redaktor, Programátor, Designér a Majitel
Hello IT. Have you tried turning it off and on again ? Are you sure it's plugged in ? |
|
| Návrat nahoru |
|
 |
Tucnak
Rotmistr


Registrace: 21.5. 2006
Příspěvky: 137
|
 Zaslal:
út 04. prosinec, 2007 9:55 Předmět: |
  |
|
| Návrat nahoru |
|
 |
Blassen
Armádní generál (Admin)


Registrace: 1.1. 1970
Příspěvky: 2127
|
 Zaslal:
út 04. prosinec, 2007 15:00 Předmět: |
  |
Ještě je potřeba přidat do funkce themeheader toto:
Přibližně tak:
{Kód}: 
function themeheader() {
global $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $nukeurl, $anonymous, $showbanners;

$bwlogin = bw_login();

good luck  |
_________________ Blassen,
Altruista, Redaktor, Programátor, Designér a Majitel
Hello IT. Have you tried turning it off and on again ? Are you sure it's plugged in ? |
|
| Návrat nahoru |
 |