Zaawansowany
Postów: 1187 Pomógł: 100
v7.02.07 Data rejestracji: 07.05.2009 17:37
|
Teraz jak zrobić useragenta pod v7.01. Mi przynajmniej jakimś cudem się udało. Instrukcja:
- Pobieramy paczkę z pierwszego posta w tym temacie, link:
http://www.php-fu...ost_128865
Jak wiecie trzeba zmienić nazwę bo jest zła nazwa w paczce na includes i wgrać na serwer.
W dodatkowe strony wkleić kod:
<?php
$result = dbquery("ALTER TABLE `".DB_PREFIX."posts` ADD `useragent` TEXT NOT NULL;");
?>
Dać PODGLĄD nie zapisywać.
Edytujemy plik /viewthread.php
1.Pod:
include LOCALE.LOCALESET."forum/main.php";
Dodajemy:
require_once INCLUDES."useragent/useragent.php";
2.Szukamy:
$result = dbquery(
"SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_showsig, p.post_smileys, p.post_author,
p.post_datestamp, p.post_ip, p.post_edituser, p.post_edittime, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size,
u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups, u.user_joined,
".($user_field['user_sig'] ? " u.user_sig," : "").($user_field['user_web'] ? " u.user_web," : "."
Zamieniamy na:
$result = dbquery(
"SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_showsig, p.post_smileys, p.post_author,
p.post_datestamp, p.post_ip, p.post_edituser, useragent, p.post_edittime, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size,
u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups, u.user_joined,
".($user_field['user_sig'] ? " u.user_sig," : "").($user_field['user_web'] ? " u.user_web," : "'".stripinput(trim(eregi_replace(" +", " ",$_SERVER['HTTP_USER_AGENT'])))."')")."
3.Szukamy:
echo "<div style='float:right' class='small'><a href='#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row+$_GET['rowstart'])."</a>";
Zamieniamy:
$useragent = $data['useragent'];
$agent = parse_user_agent($useragent);
if(!$agent['browser']) {
$agent['browser'] = "unknown browser";
}
if(!$agent['system']) {
$agent['system'] = "unknown system";
}
echo "<div style='float:right' class='small'><img src='".INCLUDES."useragent/images/icon_".$agent['system_icon'].".png' border='0' style='border:0;vertical-align:middle'/> <img src='".INCLUDES."useragent/images/icon_".$agent['browser_icon'].".png' border='0' title='".$data['useragent']."' style='border:0;vertical-align:middle'/> <a href='#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row+$_GET['rowstart'])."</a>";
Zapisujemy plik viewthread.
Teraz edytujemy plik /postreply.php
Szukamy:
$result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('".$_GET['forum_id']."', '".$_GET['thread_id']."', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
Zamieniamy na:
$result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime, useragent) VALUES ('".$_GET['forum_id']."', '".$_GET['thread_id']."', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0','".stripinput(trim(eregi_replace(" +", " ",$_SERVER['HTTP_USER_AGENT'])))."')");
Zapisujemy i wgrywamy na serwer.
Teraz edytujemy plik /postnewthread.php
Szukamy:
$result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('".$_GET['forum_id']."', '".$thread_id."', '".$message."', '".$sig."', '".$smileys."', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
Zamienamy:
$result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime, useragent) VALUES ('".$_GET['forum_id']."', '".$thread_id."', '".$message."', '".$sig."', '".$smileys."', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0', '".stripinput(trim(eregi_replace(" +", " ",$_SERVER['HTTP_USER_AGENT'])))."')");
Zapisujemy i wgrywamy na serwer.
Teraz edytujemy plik /postedit.php
Szukamy:
$result = dbquery("UPDATE ".DB_POSTS." SET post_message='$message', post_smileys='$smileys', post_edituser='".$userdata['user_id']."', post_edittime='".time()."' WHERE post_id='".$_GET['post_id']."'");
Zamieniamy:
$result = dbquery("UPDATE ".DB_POSTS." SET post_message='$message', post_smileys='$smileys', post_edituser='".$userdata['user_id']."', post_edittime='".time()."', useragent='".stripinput(trim(eregi_replace(" +", " ",$_SERVER['HTTP_USER_AGENT'])))."' WHERE post_id='".$_GET['post_id']."'");
Zapisujemy i wgrywamy na serwer.
Cieszymy się useragentem na wersji v.7.01.
Nie dało mi to spokoju więc sam się za to wziąłem :D.
Edytowane przez krystian1988 dnia 08.09.2010 06:28:48
BRAK STOPKI = BRAK POMOCY NA SUPPORCIE.PRZECZYTAJ:
Regulamin Supportu Nie pomagam na PW!!!
|
Przedszkolak
Postów: 10
Data rejestracji: 01.09.2009 13:40
|
W 7.02 w viewthead w 3 punkcie szukajcie:
echo " <a href='#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row+$_GET['rowstart'])."</a>";
W postreplay:
$result = dbquery("INSERT INTO ".DB_POSTS." (forum_id, thread_id, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_ip_type, post_edituser, post_edittime, post_editreason) VALUES ('".$_GET['forum_id']."', '".$_GET['thread_id']."', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '".USER_IP_TYPE."', '0', '0', '')");
na:
$result = dbquery(
"SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_showsig, p.post_smileys, p.post_author,
p.post_datestamp, p.post_ip, p.post_edituser, useragent, p.post_edittime,
u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups, u.user_joined,
".($user_field['user_sig'] ? " u.user_sig," : "").($user_field['user_web'] ? " u.user_web," : "'".stripinput(trim(eregi_replace(" +", " ",$_SERVER['HTTP_USER_AGENT'])))."')")."
Nie chce mi się ogarniać postedit.php, a bez odświeżenia tego przy edycji chyba świat się nie zawali, więc postedit.php nie edytujemy!
Edytowane przez Pieka dnia 17.07.2012 10:08:55
|