Yanlış okumadınız! Artık incelemelere kategori resimleri koyabileceğiz…
Yes, now you can put category images to php fusion articles.
Öncelikle şu kodları sırasıyla özel sayfalardan önizleme yapın. Bunlar veritabanına gerekli tabloları ekleyecek kodlardır.
Firstly, preview this code in custom pages. This will be add tables into database.
1 2 3 4 5 6 | $result = dbquery("ALTER TABLE `".DB_PREFIX."article_cats` ADD `article_cat_image` varchar(100) NOT NULL;"); if ($result) { echo "db tabloları tamamdır - Its OK";} else { echo "bir hata var - an error occured"; } ?> |
Ardından sıra bu kodda:
And this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['541']."', 'downloads.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['542']."', 'games.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['543']."', 'graphics.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['544']."', 'hardware.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['545']."', 'journal.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['546']."', 'members.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['547']."', 'mods.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['548']."', 'movies.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['549']."', 'network.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['550']."', 'news.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['551']."', 'php-fusion.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['552']."', 'security.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['553']."', 'software.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['554']."', 'themes.gif')"); $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image) VALUES ('".$locale['555']."', 'windows.gif')"); if ($result) { echo "resimler dbye yerleştirildi - Its OK";} else { echo "bir hata var - an error occured"; } ?> |
Önizlemeler bittikten sonra maincore.php dosyasını açıp aşağıdaki satırı buluyoruz:
After previews, open maincore.php and find this line:
1 2 3 | define("ADMIN", BASEDIR."administration/"); define("IMAGES", BASEDIR."images/"); define("IMAGES_A", IMAGES."articles/"); |
Ve altına şu kodu ekliyoruz:
1 | define("IMAGES_AC", IMAGES."article_cats/"); |
Daha sonra images klasöründe bulunan news_cats klasörünün bir kopyasını alıp adını article_cats olarak değiştirin.
By the way, copy the current news_cats folder and rename it article_cats.
Ardından administration klasörünün içinde bulunan article_cats.php dosyasını açın ve şu satırı bulun:
After this, open administration/article_cats.php and find this line:
1 | $cat_name = stripinput($_POST['cat_name']); |
Altına şu satırı ekleyin:
Add after this:
1 | $cat_image = stripinput($_POST['cat_image']); |
Aynı dosya içinde şu satırı bulun:
Still in same file find on this line:
1 2 3 4 5 | if ($action == "edit") { $result = dbquery("UPDATE ".$db_prefix."article_cats SET article_cat_name='$cat_name', article_cat_description='$cat_description', article_cat_sorting='$cat_sorting', article_cat_access='$cat_access' WHERE article_cat_id='$cat_id'"); } else { $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image, article_cat_description, article_cat_sorting, article_cat_access) VALUES ('$cat_name', '$cat_description', '$cat_sorting', '$cat_access')"); } |
Bu şekilde değiştirin:
Replace like this:
1 2 3 4 5 | if ($action == "edit") { $result = dbquery("UPDATE ".$db_prefix."article_cats SET article_cat_name='$cat_name', article_cat_image='$cat_image', article_cat_description='$cat_description', article_cat_sorting='$cat_sorting', article_cat_access='$cat_access' WHERE article_cat_id='$cat_id'"); } else { $result = dbquery("INSERT INTO ".$db_prefix."article_cats (article_cat_name, article_cat_image, article_cat_description, article_cat_sorting, article_cat_access) VALUES ('$cat_name', '$cat_image', '$cat_description', '$cat_sorting', '$cat_access')"); } |
Bu satırı bulun:
Find this line:
1 | $cat_name = $data['article_cat_name']; |
Altına ekleyin:
Add after this:
1 | $cat_image = $data['article_cat_image']; |
Bu satırı bulun:
Find this line:
1 | $cat_name = ""; |
Altına ekleyin:
Add after this:
1 | $cat_image = ""; |
Bu satırı bulun:
Find this line:
1 2 | opentable($locale['456']); } |
Altına ekle:
Add after this:
1 2 | $image_files = makefilelist(IMAGES_AC, ".|..|index.php", true); $image_list = makefileopts($image_files,$cat_image); |
Bu kodu bulun:
Find this line:
1 2 | ".$locale['458']." <input name="cat_description" value="$cat_description" class="textbox" style="width: 250px" type="text" /> |
Altına ekleyin:
Add after this:
1 2 3 | ".$locale['437']." <select name="cat_image" class="textbox" style="width: 200px"></select> |
Son olarak bu kodu bulun:
At last, find this line:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | while ($data = dbarray($result)) { $cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); echo " <strong>".$data['article_cat_name']."</strong> <span class="small">".trimlink($data['article_cat_description'], 45)."</span> ".getgroupname($data['article_cat_access'])." <a href="http://www.pher-d.net/wp-admin/%22.FUSION_SELF.$aidlink.%22&action=edit&cat_id=%22.$data%5B">".$locale['509']."</a> - <a href="http://www.pher-d.net/wp-admin/%22.FUSION_SELF.$aidlink.%22&action=delete&cat_id=%22.$data%5B">".$locale['510']."</a> \n"; $i++; } echo " \n"; } else { echo " ".$locale['518']." \n \n"; } closetable(); } |
Bu şekilde değiştirin:
Replace like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | while ($data = dbarray($result)) { $cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); if (file_exists(IMAGES_AC.$data['article_cat_image'])) { echo ""; } else { echo ""; } echo " <center><img src="http://www.pher-d.net/wp-admin/%22.IMAGES_AC.$data%5B" />".$data['article_cat_name']." </center> <span class="small">".$data['article_cat_description']."</span> ".getgroupname($data['article_cat_access'])." <a href="http://www.pher-d.net/wp-admin/%22.FUSION_SELF.$aidlink.%22&action=edit&cat_id=%22.$data%5B">".$locale['509']."</a> - <a href="http://www.pher-d.net/wp-admin/%22.FUSION_SELF.$aidlink.%22&action=delete&cat_id=%22.$data%5B">".$locale['510']."</a> \n"; $i++; } echo " \n"; } else { echo " ".$locale['518']." \n \n"; } closetable(); } |
Daha sonra locale\Turkish\admin\news-articles.php dosyasını açın ve bu satırı bulun:
After that open locale\Turkish\admin\news-articles.php and find this line:
1 | $locale['472'] = "Azalan"; |
Altına ekleyin:
Add after this:
1 | $locale['473'] = "Kategori Resmi"; |
/locale/turkish/ klasörü içine article_cats.php dosyası oluşturun ve içine aşağıdaki satırları kopyalayıp kayıt ederseniz hata almazsınız.
Create a file under name of article_cats.php into /locale/turkish and copy/paste this lines in it to saving from an error.
1 2 3 4 5 6 7 8 9 | $locale['400'] = "İnceleme Kategorileri"; $locale['401'] = "Kategori:"; $locale['402'] = "İnceleme Sayısı:"; $locale['403'] = "Diğer İncelemeler Kategorisi"; $locale['404'] = "Bu kategori içinde inceleme bulunmamaktadır."; $locale['405'] = "Daha fazla"; $locale['406'] = "Bütün Kategorileri Göster"; $locale['407'] = "İnceleme kategorisi tanımlanmamış."; ?> |
Modifikasyon burada bitti. Ama ana dizine atmamız gereken article_cats.php dosyasının kodlaması karışık olduğundan yazmadım.
Dosyayı buradan indirebilirsiniz.
The modification finished. The file article_cats.php is hard-coded. So i didn’t wrote here its content. You can download it here.
Bu modifikasyonlarla uğraşmadan sadece eski dosyaları (YEDEK ALMAYI UNUTMADAN) değiştirmek isterseniz Dosyaları indirmek için tıklayın
If you don’t want work on modification, you can download the files which must be overwrited onto older files.
Click here for download.
Not: images/article_cats klasöründeki resimleri kendiniz değiştirmeniz gerekmektedir. İçinden çıkacak olanlar haber kategori resimlerinin renklerinin değiştirilmiş halidir.
Notice: You must change the pictures in images/article_cats folder. Cause they inverted version of news_cats images.
Güle güle kullanın.
Enjoy ![]()
0 Responses to “PHP-Fusion’da İnceleme Kategorileri Sayfası”
Leave a Reply