Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: News klaida
Parašė tautvix· 2008 Bal. 8 13:04:40
#1
Isimeciau kad kitaip rodytu naujienas bet viskas kaip ir veikia bet meta viena eror virs naujienų . Gal zinot kaip butu galima istaisyti ?
Redagavo MAnjack· 2008 Bal. 8 16:04:24
Parašė Gugiss· 2008 Bal. 8 14:04:05
#2
kaip mes galim zinot kaip patvarkyt jei nezinom koks error'as krc bent cia parasyk ta error'a zmogau
Parašė tautvix· 2008 Bal. 8 14:04:29
#3
Va imeciau paveikleli
Parašė MAnjack· 2008 Bal. 8 14:04:29
#4
į taplyklą įdėtk, kad siųstis nereikėtų, niekas kitaip jo net neatsidarys.
Parašė Gugiss· 2008 Bal. 8 14:04:33
#5
nera prie naujienu stulpelio news_sticky. pasidaryk db kopija ir darasyk
Parašė tautvix· 2008 Bal. 8 14:04:46
#6
Ta prasme prie news.php darasyt news_sticky ? ar sukurt news_sticky.php ?
Parašė Gugiss· 2008 Bal. 8 14:04:12
#7
saite eik i administracijos panele -> sistemos administracija->Duombazės kopijos ir padaryk kopija paskui prie kiekvienos naujienos yraso parasyk `news_sticky`
Parašė tautvix· 2008 Bal. 8 14:04:11
#8
Nu pasidarau ta kokpija o kur ten ta `news_sticky`
darasyt ?
Parašė Enzo· 2008 Bal. 8 14:04:39
#9
Gugiss parašė:
saite eik i administracijos panele -> sistemos administracija->Duombazės kopijos ir padaryk kopija paskui prie kiekvienos naujienos yraso parasyk `news_sticky`
Nesamonė:|
Parašė Gugiss· 2008 Bal. 8 14:04:42
#10
kas nesamone?
Nu va buna toks naujienos yrasas sql faile
INSERT INTO `sd1QvcE2c8dfThuvGmL5_news` (`news_id`, `news_subject`, `news_cat`, `news_news`, `news_extended`, `news_breaks`, `news_name`, `news_datestamp`, `news_start`, `news_end`, `news_visibility`, `news_reads`, `news_sticky`, `news_allow_comments`, `news_allow_ratings`, `news_rss`)
ir ten turi but tas `news_sticky` jei nera
Redagavo Gugiss· 2008 Bal. 8 14:04:21
Parašė tautvix· 2008 Bal. 8 14:04:03
#11
Gugiss parašė:
kas nesamone?
Nu pasidarau ta kokpija o kur ten ta `news_sticky`
darasyt ?
Parašė bad_user· 2008 Bal. 8 14:04:48
#12
Gugi nusišnekėjai. Tautvix atsidaryk faila ir išimk kad jo nenaudotu. Beje temos pavadinimas neatitinka turinio.
Parašė Gugiss· 2008 Bal. 8 14:04:39
#13
SoNG, nenusisnekejau man tas pats buvo ir taip susitvarkiau :P
Parašė tautvix· 2008 Bal. 8 14:04:02
#14
SoNG parašė:
Gugi nusišnekėjai. Tautvix atsidaryk faila ir išimk kad jo nenaudotu. Beje temos pavadinimas neatitinka turinio.
Gali konkreciau ?
Parašė bad_user· 2008 Bal. 8 14:04:45
#15
Duok savo failo koda nes kaip matau pats nieko nepadarysi...
Parašė tautvix· 2008 Bal. 8 15:04:04
#16
Netelpa cia irasyt.... ?|
Parašė bad_user· 2008 Bal. 8 15:04:14
#17
Išjunk smiles leis.. :|
Parašė tautvix· 2008 Bal. 8 15:04:13
#18
<?php
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
if (isset($skaityti) && !isNum($skaityti)) fallback(FUSION_SELF);
if ($settings['news_style'] == "1") { $i = 0; $rc = 0; $ncount = 1; $ncolumn = 1; $news_[0] = ""; $news_[1] = ""; $news_[2] = ""; } else { $i = 1; }
$items_per_page = 11;
if (!isset($skaityti)) {
$rows = dbcount("(news_id)", "news", groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery(
"SELECT tn.*, tc.*, user_id, user_name FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
LEFT JOIN ".$db_prefix."news_cats tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().")
ORDER BY news_sticky DESC, news_datestamp DESC LIMIT $rowstart,$items_per_page"
);
$numrows = dbrows($result);
if ($settings['news_style'] == "1") $nrows = round((dbrows($result) - 1) / 2);
while ($data = dbarray($result)) {
$news_cat_image = "";
$news_subject = "<a name='news_".$data['news_id']."' id='news_".$data['news_id']."'></a>".stripslashes($data['news_subject']);
if ($data['news_cat_image']) {
$news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat_id']."'><img src='".IMAGES_NC.$data['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
} else {
$news_cat_image = "";
}
$news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"news_date" => $data['news_datestamp'],
"news_ext" => $data['news_extended'] ? "y" : "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
"news_allow_comments" => $data['news_allow_comments']
);
if ($settings['news_style'] == "1") {
if ($rows <= 2 || $ncount == 1) {
$news_[0] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
$news_[0] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
$news_[0] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
$news_[0] .= "<tr>\n<td align='center' class='tbl2'>\n";
if (checkrights("N")) $news_[0] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$news_info['news_id']."'>\n";
$news_[0] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$news_info['user_id']."'>".$news_info['user_name']."</a> ".$locale['041'].showdate("longdate", $news_info['news_date'])." ·\n";
if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
$news_[0] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?skaityti=".$news_info['news_id']."'>".$locale['042']."</a> ·\n" : "";
$news_[0] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?skaityti=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> ·\n" : "";
$news_[0] .= $news_info['news_reads'].$locale['044']." ·\n";
}
$news_[0] .= "<a href='print.php?type=N&item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>";
if (checkrights("N")) { $news_[0] .= " · <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[0] .= "</span>\n"; }
$news_[0] .= "</td>\n</tr>\n</table>\n";
if ($ncount != $rows) $news_[0] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
} else {
if ($i == $nrows && $ncolumn != 2) { $ncolumn = 2; $i = 0; }
$row_color = ($rc % 2 == 0 ? "tbl2" : "tbl1");
$news_[$ncolumn] .= "<table width='100%' cellpadding='0' cellspacing='0'>\n";
$news_[$ncolumn] .= "<tr>\n<td class='tbl2'><b>$news_subject</b></td>\n</tr>\n";
$news_[$ncolumn] .= "<tr>\n<td class='tbl1' style='text-align:justify'>$news_news</td>\n</tr>\n";
$news_[$ncolumn] .= "<tr>\n<td align='center' class='tbl2'>\n";
if (checkrights("N")) $news_[$ncolumn] .= "<form name='editnews".$news_info['news_id']."' method='post' action='".ADMIN."news.php".$aidlink."&news_id=".$news_info['news_id']."'>\n";
$news_[$ncolumn] .= "<span class='small2'><img src='".THEME."images/bullet.gif' alt=''> <a href='profile.php?lookup=".$news_info['user_id']."'>".$news_info['user_name']."</a> ".$locale['041'].showdate("longdate", $news_info['news_date']);
if ($news_info['news_ext'] == "y" || $news_info['news_allow_comments']) {
$news_[$ncolumn] .= "<br>\n";
$news_[$ncolumn] .= $news_info['news_ext'] == "y" ? "<a href='".FUSION_SELF."?skaityti=".$news_info['news_id']."'>".$locale['042']."</a> ·\n" : "";
$news_[$ncolumn] .= $news_info['news_allow_comments'] ? "<a href='".FUSION_SELF."?skaityti=".$news_info['news_id']."'>".$news_info['news_comments'].$locale['043']."</a> ·\n" : "";
$news_[$ncolumn] .= $news_info['news_reads'].$locale['044']." ·\n";
} else {
$news_[$ncolumn] .= " ·\n";
}
$news_[$ncolumn] .= "<a href='print.php?type=N&item_id=".$news_info['news_id']."'><img src='".THEME."images/printer.gif' alt='".$locale['045']."' style='border:0px;vertical-align:middle;'></a>\n";
if (checkrights("N")) { $news_[$ncolumn] .= " · <input type='hidden' name='edit' value='edit'><a href='javascript:document.editnews".$news_info['news_id'].".submit();'><img src='".IMAGES."edit.gif' alt='".$locale['048']."' title='".$locale['048']."' style='vertical-align:middle;border:0px;'></a></span>\n</form>\n"; } else { $news_[$ncolumn] .= "</span>\n"; }
$news_[$ncolumn] .= "</td>\n</tr>\n</table>\n";
if ($ncolumn == 1 && $i < ($nrows - 1)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
if ($ncolumn == 2 && $i < (dbrows($result) - $nrows - 2)) $news_[$ncolumn] .= "<div><img src='".THEME."images/blank.gif' alt='' width='1' height='8'></div>\n";
$i++; $rc++;
}
$ncount++;
} else {
render_news($news_subject, $news_news, $news_info);
if ($i != $numrows) { tablebreak(); } $i++;
}
}
if (isset($visos)) {
opentable("Visos naujienos");
$query3 = dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC");
if (mysql_num_rows($query3) == 0) {
echo "<center>Naujienų nėra</center>";
} else {
while ($data = dbarray($query3)) {
echo "<a href='".BASEDIR."naujienos.php?skaityti=".$data['news_id']."'><b>".trimlink($data[news_subject], 100)." </b><br></a>";
}
}
closetable();
} elseif ($settings['news_style'] == "1") {
openside("Naujienos");
$result=dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY news_datestamp DESC LIMIT 0,3");
if(dbrows($result)!=0){
while($data=dbarray($result)){
$result2 = dbquery("SELECT news_cat_name FROM ".DB_PREFIX."news_cats WHERE news_cat_id='$data[news_cat]'");
$n_id = $data['news_id'];
$comments_n = dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id=".$data['news_id']."");
$date = $data['news_datestamp'];
$n_date = showdate("%Y %m %d", $date);
$v_id = $data['news_reads'];
$category = dbresult($result2,0);
$news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
$query = dbquery("SELECT news_cat_image FROM ".$db_prefix."news_cats WHERE news_cat_id = '".$data['news_cat']."'");
$cat = dbarray($query);
echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-top:1px #ccc dotted;'>\n
<tr><td valign=top>";
echo "<img src='".IMAGES."news_cats/".$cat['news_cat_image']."' alt='".$data['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a> </td>
<td valign=top>
<a href='".BASEDIR."naujienos.php?skaityti=".$data['news_id']."' title='".$data['news_subject']."' class='slink'><b>".trimlink($data[news_subject], 100)."</b></a>
<br> <i>$n_date • Komentarai $comments_n • Skaityta $v_id </i></a>
<br><br>".$news_news."</td></tr></table><br>";
}
$result3 = dbquery("SELECT * FROM ".DB_PREFIX."news WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") ORDER BY news_datestamp DESC LIMIT 3,5");
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n";
while ($data = dbarray($result3)) {
$title = $data['news_subject'];
$sh_title = $title;
$comments_n = dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id=".$data['news_id']."");
$v_id = $data['news_reads'];
$date = $data['news_datestamp'];
$n_date = showdate("%Y %m %d", $date);
echo "<tr>
<td class='small2' style='border-top:1px #ccc dotted;'>
<img src='".THEME."images/bullet.gif'> $n_date </span>
<a href='".BASEDIR."naujienos.php?skaityti=".$data['news_id']."'><b>".trimlink($data[news_subject], 100)." </b></a> [$v_id | $comments_n] </td></tr>\n";
}
echo "<tr><td class='small2' style='border-top:1px #ccc dotted;'>
<a href='".BASEDIR."naujienos.php?visos'>Visos naujienos</a> - <a href='".BASEDIR."news_cats.php'>Naujienu kategorijos</a></td></tr>\n";
echo "</table>\n";
}
closeside();
}
if ($rows > $items_per_page) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$items_per_page,$rows,3)."\n</div>\n";
} else {
openside("Naujienu nera");
echo "Naujienu nera";
closeside();
}
} else {
include INCLUDES."comments_include.php";
include INCLUDES."ratings_include.php";
$result = dbquery(
"SELECT tn.*, user_id, user_name FROM ".$db_prefix."news tn
LEFT JOIN ".$db_prefix."users tu ON tn.news_name=tu.user_id
WHERE news_id='$skaityti'"
);
if (dbrows($result)!=0) {
$data = dbarray($result);
if (checkgroup($data['news_visibility'])) {
$news_cat_image = "";
if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
$result2 = dbquery("UPDATE ".$db_prefix."news SET news_reads=news_reads+1 WHERE news_id='$skaityti'");
$data['news_reads']++;
}
$news_subject = $data['news_subject'];
if ($data['news_cat'] != 0) {
$result2 = dbquery("SELECT * FROM ".$db_prefix."news_cats WHERE news_cat_id='".$data['news_cat']."'");
if (dbrows($result2)) {
$data2 = dbarray($result2);
$news_cat_image = "<a href='news_cats.php?cat_id=".$data2['news_cat_id']."'><img src='".IMAGES_NC.$data2['news_cat_image']."' alt='".$data2['news_cat_name']."' align='left' style='border:0px;margin-top:3px;margin-right:5px'></a>";
}
}
$news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
if ($news_cat_image != "") $news_news = $news_cat_image.$news_news;
$news_info = array(
"news_id" => $data['news_id'],
"user_id" => $data['user_id'],
"user_name" => $data['user_name'],
"news_date" => $data['news_datestamp'],
"news_ext" => "n",
"news_reads" => $data['news_reads'],
"news_comments" => dbcount("(comment_id)", "comments", "comment_type='N' AND comment_item_id='".$data['news_id']."'"),
"news_allow_comments" => $data['news_allow_comments']
);
render_news($news_subject, $news_news, $news_info);
if ($data['news_allow_comments']) showcomments("N","news","news_id",$skaityti,FUSION_SELF."?skaityti=$skaityti");
if ($data['news_allow_ratings']) showratings("N",$skaityti,FUSION_SELF."?skaityti=$skaityti");
} else {
redirect(FUSION_SELF);
}
} else {
redirect(FUSION_SELF);
}
}
require_once "side_right.php";
require_once "footer.php";
?>
Redagavo tautvix· 2008 Bal. 8 15:04:45
Parašė bad_user· 2008 Bal. 8 15:04:17
#19
<?php
$db_prefixas = 'prefixas_';
$result = dbquery("CREATE TABLE ".$db_prefixas."news (
news_id SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
news_subject VARCHAR(200) NOT NULL DEFAULT '',
news_cat SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
news_news TEXT NOT NULL,
news_extended TEXT NOT NULL,
news_breaks CHAR(1) NOT NULL DEFAULT '',
news_name SMALLINT(5) UNSIGNED NOT NULL DEFAULT '1',
news_datestamp INT(10) UNSIGNED NOT NULL DEFAULT '0',
news_start INT(10) UNSIGNED NOT NULL DEFAULT '0',
news_end INT(10) UNSIGNED NOT NULL DEFAULT '0',
news_visibility TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
news_reads SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
news_sticky TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
news_allow_comments TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
news_allow_ratings TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
PRIMARY KEY (news_id)
) TYPE=MyISAM;");
?>
Bandyk per pridėtinius. prefixas_ pirmoje eilutėje keiti į savo visos db prefixa. :)
Parašė tautvix· 2008 Bal. 8 15:04:42
#20
SoNG parašė:
<?php
$db_prefixas = 'prefixas_';
$result = dbquery("CREATE TABLE ".$db_prefixas."news (
news_id SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
news_subject VARCHAR(200) NOT NULL DEFAULT '',
news_cat SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
news_news TEXT NOT NULL,
news_extended TEXT NOT NULL,
news_breaks CHAR(1) NOT NULL DEFAULT '',
news_name SMALLINT(5) UNSIGNED NOT NULL DEFAULT '1',
news_datestamp INT(10) UNSIGNED NOT NULL DEFAULT '0',
news_start INT(10) UNSIGNED NOT NULL DEFAULT '0',
news_end INT(10) UNSIGNED NOT NULL DEFAULT '0',
news_visibility TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
news_reads SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
news_sticky TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
news_allow_comments TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
news_allow_ratings TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',
PRIMARY KEY (news_id)
) TYPE=MyISAM;");
?>
Bandyk per pridėtinius. prefixas_ pirmoje eilutėje keiti į savo visos db prefixa. :)
Nesupratau....
Parašė Gugiss· 2008 Bal. 8 15:04:12
#21
hakeri tu sakai kad nusisnekejau :D pas ji DB news lentelej nera news_sticky eilutes, ir prie naujienu yrasu reikejo darasyt news_sticky. hakeri tu :D
Parašė bad_user· 2008 Bal. 8 15:04:37
#22
Kas čia hakeris? :| Ka tu čia pezi? :|
Tu iš musės drambli darai. O aš jam paprasta koda daviau.. :s
Redagavo bad_user· 2008 Bal. 8 15:04:11
Parašė Gugiss· 2008 Bal. 8 15:04:16
#23
soriukas song, bet as teisingai pasakiau ir sutvarkiau :P
Parašė bad_user· 2008 Bal. 8 16:04:52
#24
Knistis po ten ir pan. Kam to reikia. Atlieki užklausa ir viskas. :?
Redagavo bad_user· 2008 Bal. 8 16:04:54
Parašė zweris· 2008 Bal. 8 16:04:41
#25
tautvix: Tą kodą kur davė song įdėk į pridetinius puslapius ;)
Parašė bad_user· 2008 Bal. 8 16:04:49
#26
Taigi jau išsprendė problema durnu budu :D
Parašė Gugiss· 2008 Bal. 8 16:04:55
#27
zwerie juokini tu :D