Sık Sorulan Sorular

Webmaster Topluluğuna Hoşgeldiniz
Üyelerimizin arasına katılmak ister misiniz? Kayıt olmaktan sakın çekinme.
Kayıt ol

Watson

Bronz Üye
0   0   0
25 Tem 2018
63
0
#1
Soru: En Çok Okunan Haberleri Nasıl Gösteririm?

Cevap: Sistem Yönetimi >> Blok Ekle >> Yeni Blok Ekle Diyoruz

Kod:
openside("En Çok Okunan Haberler");
$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_reads DESC LIMIT 0,5"
);
if (dbrows($result) != 0) {
while($data = dbarray($result)) {
$itemsubject = trimlink($data['news_subject'], 23);
echo "<img src='".THEME."images/bullet.gif' alt=''> <a href='".BASEDIR."news.php?readmore=".$data['news_id']."' title='".$data['news_subject']."' class='side'>$itemsubject</a><br>\n";
}
} else {
echo "<center>".$locale['004']."</center>\n";
}


closeside();
Soru: Site Bannerini Nasıl Ortalarım?

Cevap: subheader.php sayfasını editörde aç

Kod:
render_header("<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."' title='".$settings['sitename']."'>");
ilgili kodu şöyle değiştir

Kod:
render_header("<center><img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."' title='".$settings['sitename']."'><center>");
Soru : Dosya İndirme Menüsüne Nasıl Oylama Eklerim<br>

Cevap:

BİRİNCİ AŞAMA

locale/Turkish/downloads.php açalım

Bulalım:
Kod:
$locale['416'] = "Download"
Hemen Bitimine Bu Kodu Ekleyelim:
Kod:
$locale['417'] = "Rating is available to Members only.<br><br>Please login or register to vote.";
$locale['418'] = "Please select your Rating";
$locale['419'] = "Post Rating";
$locale['420'] = "Rating: ";
$locale['421'] = "Total votes: ";

İKİNCİ AŞAMA


downloads.php açalım


Bulalım:
Kod:
include LOCALE.LOCALESET."downloads.php";


Hemen Bitimine Ekleyelim:
Kod:
if (isset($_POST['post_rating'])) {
if (isNum($_POST['rating']) && $_POST['rating'] > 0 && $_POST['rating'] < 6) {
$result = dbquery("INSERT INTO ".DB_PREFIX."ratings (rating_item_id, rating_type, rating_user, rating_vote, rating_datestamp, rating_ip) VALUES ('".$_POST['rating_item_id']."', 'D', '".$userdata['user_id']."', '".$_POST['rating']."', '".time()."', '".USER_IP."')");
}
header("Location: downloads.php?cat_id=".$cat_id);
}
ÜÇÜNCÜ AŞAMA

Bulalım:
Kod:
echo "</table>\n";


Hemen Bitimine Ekleyelim:
Kod:
if (iMEMBER) $download_rating=dbarray(dbquery("SELECT rating_vote,rating_datestamp FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['download_id']."' AND rating_type='D' AND rating_user='".$userdata['user_id']."'"));
if (!iMEMBER) {
echo "<tr><td colspan='3' class='tbl1' align='center'>".$locale['417']."</td></tr>\n";
} elseif ($download_rating['rating_vote']>0) {
$total_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['download_id']."' AND rating_type='D'"),0);
$sum_votes = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".DB_PREFIX."ratings WHERE rating_item_id='".$data['download_id']."' AND rating_type='D'"),0);
$votes = round($sum_votes/$total_votes, 0);
echo "<tr><td colspan='3' class='tbl1' align='center'><b>".$locale['420']."</b>(".$votes."/5) - <b>".$locale['421']."</b> $total_votes</td></tr>";
}else{
echo "<tr><td colspan='3' class='tbl1' align='center'><form name='postrating' method='post' action='".FUSION_SELF."?cat_id=".$cat_id."'>";
echo "<div align='center'>".$locale['418'].": <select name='rating' class='textbox'>";
echo "<option value='1'>1</option>\n";
echo "<option value='2'>2</option>\n";
echo "<option value='3'>3</option>\n";
echo "<option value='4'>4</option>\n";
echo "<option value='5'>5</option>\n";
echo "</select>\n";
echo "<input type='hidden' name='rating_item_id' value='".$data['download_id']."'>\n";
echo "<input type='submit' name='post_rating' value='".$locale['419']."' class='button'></form></td></tr>\n";
}