السلام عليكم
احتاج طريقه تخصيص لكل قسم في سكربت 4images صورة خاصه
مثل
![]()
بدل الطريقه العاديه
تكفووون يا اخوان الي يعرف لا يبخل علي بالطريقه
السلام عليكم
احتاج طريقه تخصيص لكل قسم في سكربت 4images صورة خاصه
مثل
![]()
بدل الطريقه العاديه
تكفووون يا اخوان الي يعرف لا يبخل علي بالطريقه
__________________
قمة الألم أن تنتهي من صنع سفينتك ثم تكتشف أن البحر قد جف !!
FastCall
لوضع صورة مقابل كل قسم عليك تغيير الآتي
الملفات المتغيرة
------
global.php
admin/categories.php
admin/images.php (optional)
includes/functions.php
templates/<your template>/category_bit.html
------
الملفات الجديدة
--------
catimage_install.php
-------
الخطوة الأولى
في ملف global.php
ابحث عن
وأضف اليه بالتاليكود PHP:
$sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
, c.cat_image
مجرد زيادة
ليصبح
هذا بالنسبة للنسخة 1.7كود PHP:
$sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images, c.cat_image
اما بالنسبة للنسخة 1.7.1
ابحث عن
واضف اليهكود PHP:
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
, cat_image
ليصبح
الخطوة الثانيةكود PHP:
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_image
في ملف
admin/categories.php
ابحث عن التالي (ستجد هذا السطر مكرر مرتين) والتغيير سيكون للسطرين
وضع أسفل منهكود PHP:
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
الخطوة التاليةكود PHP:
//Category Image
$cat_image = (intval($HTTP_POST_VARS['cat_image'])) ? intval($HTTP_POST_VARS['cat_image']) : 0;
//End Category Image
ابحث عن
واستبدله بالتاليكود PHP:
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
VALUES
('$cat_name', '$cat_description', $cat_parent_id, $cat_order, $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
ثم ابحث عنكود PHP:
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_image)
VALUES
('$cat_name', '$cat_description', $cat_parent_id, $cat_order, $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment, $cat_image)";
واستبدله بالتاليكود PHP:
SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment
ثم ابحث عنكود PHP:
SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment, cat_image = $cat_image
واستبدله بالتاليكود PHP:
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
ثم ابحث عنكود PHP:
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_image
واستبدله بالتاليكود PHP:
show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']);
ثم ابحث عنكود PHP:
// Category image
$cat_image = "";
if ($result['cat_image'])
{
$sql = "SELECT image_id, image_media_file, image_thumb_file, image_name, cat_id
FROM ".IMAGES_TABLE."
WHERE image_id = ".$result['cat_image'];
if ($image_row = $site_db->query_firstrow($sql))
{
if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
{
$cat_image = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
}
else
{
$cat_image = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
}
$file_info = @getimagesize($cat_image);
$dim = 50;
$width = $file_info[0];
$height = $file_info[1];
if ($width && $height) {
if ($width > $dim || $height > $dim) {
@$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dim;
$new_height = round(($dim/$width) * $height);
}else {
$new_width = round(($dim/$height) * $width);
$new_height = $dim;
}
}else{
$new_width = $width;
$new_height = $height;
}
}else{
$new_width = $dim;
$new_height = $dim;
}
$cat_image = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\"><img src=\"".$cat_image."\" width=\"".$new_width."\" height=\"".$new_height."\"></a> <a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\">".$image_row['image_name']."</a>";
}
}
$value = $result['cat_image'];
if (isset($HTTP_POST_VARS['cat_image'])/* && $value == ""*/) {
$value = stripslashes($HTTP_POST_VARS['cat_image']);
}
echo "<tr class=\"".get_row_bg()."\">\n<td><p class=\"rowtitle\">Category image</p></td>\n<td><p><input type=\"text\" size=\"5\" name=\"cat_image\" value=\"".$value."\"> $cat_image</p></td>\n</tr>\n";
//End Category image
واستبدله بالتاليكود PHP:
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
ولملف includes/functions.phpكود PHP:
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, cat_image
ابحث عن
وضع فوقهكود PHP:
if (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0 || defined("SHOW_RANDOM_CAT_IMAGE") && SHOW_RANDOM_CAT_IMAGE == 0) {
وفي ملفكود PHP:
$cat_image = "";
if ($cat_cache[$category_id]['cat_image'])
{
$sql = "SELECT image_id, image_media_file, image_thumb_file, cat_id
FROM ".IMAGES_TABLE."
WHERE image_id = ".$cat_cache[$category_id]['cat_image'];
if ($image_row = $site_db->query_firstrow($sql))
{
if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
{
$cat_image = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
}
else
{
$cat_image = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
}
}
}
$site_template->register_vars("cat_image", $cat_image);
templates/<your template>/category_bit.html
ضع هذا السطر في المكان الذي تراه مناسبا
يتبعكود PHP:
{if cat_image}<img src="{cat_image}">{endif cat_image}
__________________
إستخدم ملفك الخاص لكتابة توقيعك
والملف catimage_install.php
سيكون كالتالي
ثم اذهب الى لوحة التحكم وقم باللازمكود PHP:
<?php
// Installer version 2 (by V@no) based on original version by SLL
define('ROOT_PATH', './');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'global.php');
$mod_name = "MOD Category Image";
$mod_author = "V@no";
$sql_data = array(
"ALTER TABLE `".CATEGORIES_TABLE."` ADD `cat_image` MEDIUMINT( 8 ) NOT NULL"
);
$error_log = array();
$error_msg = "";
if ($action == "modinstall") {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=windows-1251" http-equiv="Content-Type">
<link rel="stylesheet" href="admin/cpstyle.css">
<title>4images Installer</title>
</head>
<body leftmargin="20" topmargin="20" marginwidth="20" marginheight="20" bgcolor="#FFFFFF">
<table cellpadding="0" cellspacing="0" border="0" width="500" align="center">
<tr><td class="tableborder"><img src="admin/images/logo_installer.gif" width="500" height="45"><br />
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr class="tablerow2"><td><b><?php echo $mod_name; ?></b> (by <?php echo $mod_author; ?>)</td></tr>
</table>
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr class="tableheader"><td colspan="2"><b><span class="tableheader">Installation status</span></b></td></tr>
<tr class="tablerow2"><td colspan="2"><br /><blockquote>
<?php
$date = time();
$error = 0;
foreach ($sql_data as $val){
ob_start();
$ok = $site_db->query($val);
$content = ob_get_contents();
ob_end_clean();
if ($ok) {
$log[$val] = "<font color=\"green\">Done</font>";
}
else {
preg_match("#<br \/><b>(.*)</b><br \/>#",$content, $reg);
$log[$val] = "<font color=\"red\">Error: </font><b>".$reg[1]."</b>";
$error = 1;
}
}
if (!$error) { echo "<center><h4>Database successfuly updated!</h4></center>"; }
$error_msg .= "<ol>";
foreach ($log as $key => $val) {
$error_msg .= sprintf("<li>%s</li><br /><i>$key</i>", $val);
}
$error_msg .= "</ol>";
echo "<p class=\"rowtitle\">".$error_msg."</p>";
?>
</blockquote></td></tr>
<tr class="tablefooter"><td colspan="2"> </td></tr>
</table>
</td>
</tr>
</table>
</table>
<p align="center"> Powered by <b>4images</b> <?php echo SCRIPT_VERSION; ?><br />Copyright © 2002 <a href="http://www.4homepages.de" target="_blank">4homepages.de</a><br />Installer by SLL</p>
</body>
</html>
<?php
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=windows-1251" http-equiv="Content-Type">
<link rel="stylesheet" href="admin/cpstyle.css">
<title>4images Installer</title>
</head>
<body leftmargin="20" topmargin="20" marginwidth="20" marginheight="20" bgcolor="#FFFFFF">
<form action="<?php echo $self_url; ?>" name="form" method="post">
<table cellpadding="0" cellspacing="0" border="0" width="500" align="center">
<tr><td class="tableborder"><img src="admin/images/logo_installer.gif" width="500" height="45"><br />
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr class="tablerow2"><td><b><?php echo $mod_name; ?></b> (by <?php echo $mod_author; ?>)</td></tr>
<tr class="tablefooter"><td align="center"> </td></tr>
</table>
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr class="tablerow"><td colspan="2" align="right"></td></tr>
<tr class="tablerow2"><td colspan="2"><center>
This script will modify your 4images database, so please<br><b>
<font color="#FF0000">ALWAYS BACKUP YOUR DATABASE BEFORE RUNNING THIS MOD!</b></font><br><br>
Please check out all fields shown below.<br>
If they do not correspond to your settings, please<br><b>DO NOT START INSTALLER</b>!
</center></td></tr>
<tr class="tableheader"><td colspan="2"><b><span class="tableheader">Database configuration</span></b></td></tr>
<tr class="tablerow"><td>Database server type</td><td><?php echo $db_servertype; ?></td></tr>
<tr class="tablerow2"><td>Database server hostname</td><td><?php echo stripslashes($db_host); ?></td></tr>
<tr class="tablerow"><td>Database name</td><td><?php echo stripslashes($db_name); ?></td></tr>
<tr class="tablerow2"><td>Prefix for tables in database</td><td><?php echo stripslashes($table_prefix); ?></td></tr>
<tr class="tablefooter"><td colspan="2"><center><input type="hidden" name="action" value="modinstall"><input type="submit" value="Start modify database" class="button" name="submit"></center></td></tr>
</table>
</td>
</tr>
</table>
</form>
<p align="center"> Powered by <b>4images</b> <?php echo SCRIPT_VERSION ; ?><br />Copyright © 2002 <a href="http://www.4homepages.de" target="_blank">4homepages.de</a></p>
</body>
</html>
الاخوة في سوالف ارجوكم احفظوا حقي في هذا الشرح
شكرا لكم
__________________
إستخدم ملفك الخاص لكتابة توقيعك
aq8.net
يعجبونك بسوالف، يحفظون حقك ... بالتعديل على المواضيع فقط !!
الموضوع الاصلي: http://www.swalif.net/softs/showthread.php?t=142447
aq8.net
الله يجزاك الجنه قول امين
تراني عليمي بقول وش سويت والنتيجه
كل الي قلته عملته
بالنسبه للملف هذا حطيته بالمجلد الرئيسي للسكربت ورحت له لقيت خيار ضغط عليه وسكرتها
catimage_install.php
ذكرت هذا الملف وش سالفته !
admin/images.php (optional)
بعد ما عدلت على الملفات ورفعتها رحت لوحه التحكم اطالع يمين ويسار ما اشووف شي غير
انضاف خيار Category image في تعديل الاقسام بس اختفى زر حفظ التغييرات
![]()
الصوره الثانيه من سكربت ثاني
![]()
الصور وين احطها ؟ في مجلد icons
انا جربت على 1.7
اذا كنت غلطان بشي تكفى لا تنساني
الله يجزاك خير مره ثانيه يكفي تعبك بالشرح
تحياتي لك
__________________
قمة الألم أن تنتهي من صنع سفينتك ثم تكتشف أن البحر قد جف !!
FastCall
اتوقع والله اعلم انك غيرت بالتمبلت شي
لان السالفة سهله
يا يطلع ....... يا ما يطلع
واضح انها شغله تمبلت وتغيرت عندك
وللعلم انا لقيت الشرح في موقع الماني ترجمه واحد للانجليزي وانا ترجمته لك للعربي
__________________
إستخدم ملفك الخاص لكتابة توقيعك
اخوي
روح لأي صورة انت رفعتها مسبقا
وعدلها
راح تلقى فراغ جديد فيها ( يسألك هل تريد ان تجعلها صورة لقسم نعم ام لا)
خلها نعم
ومن لوحة التحكم روح لقسم تعديل الاقسام ثم تعديل قسم
واختر الصورة من هناك
اعتقد ماكو اسهل من هالشي
والله يوفقك وشكرا لدعائك لي
جزاك الله خييييييير
__________________
إستخدم ملفك الخاص لكتابة توقيعك
مشكوور
http://www.swalif.net/softs/showthread.php?t=138819
ملاحظة: يرجى نسخ المحتوى الى Notpad للتخلص من الالوان في حالة استخدامك محرر PHP
تعديل بسيط بالخطوة قبل الاخيرة من تعديل ملف admin/categories.php
وهي كالتالي
الا تستبدل الكود فقط اضف الكود الجديد اعلى منهثم ابحث عن
كود PHP:
show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']);
واستبدله بالتالي
كود PHP:
// Category image
$cat_image = "";
if ($result['cat_image'])
{
$sql = "SELECT image_id, image_media_file, image_thumb_file, image_name, cat_id
FROM ".IMAGES_TABLE."
WHERE image_id = ".$result['cat_image'];
if ($image_row = $site_db->query_firstrow($sql))
{
if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
{
$cat_image = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
}
else
{
$cat_image = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
}
$file_info = @getimagesize($cat_image);
$dim = 50;
$width = $file_info[0];
$height = $file_info[1];
if ($width && $height) {
if ($width > $dim || $height > $dim) {
@$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dim;
$new_height = round(($dim/$width) * $height);
}else {
$new_width = round(($dim/$height) * $width);
$new_height = $dim;
}
}else{
$new_width = $width;
$new_height = $height;
}
}else{
$new_width = $dim;
$new_height = $dim;
}
$cat_image = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\"><img src=\"".$cat_image."\" width=\"".$new_width."\" height=\"".$new_height."\"></a> <a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\">".$image_row['image_name']."</a>";
}
}
$value = $result['cat_image'];
if (isset($HTTP_POST_VARS['cat_image'])/* && $value == ""*/) {
$value = stripslashes($HTTP_POST_VARS['cat_image']);
}
echo "<tr class=\"".get_row_bg()."\">\n<td><p class=\"rowtitle\">Category image</p></td>\n<td><p><input type=\"text\" size=\"5\" name=\"cat_image\" value=\"".$value."\"> $cat_image</p></td>\n</tr>\n";
//End Category image
يعني ابحث عن
واضف اعلى منه :كود PHP:
show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']);
ومشكور لصاحب الموضوعكود PHP:
// Category image
$cat_image = "";
if ($result['cat_image'])
{
$sql = "SELECT image_id, image_media_file, image_thumb_file, image_name, cat_id
FROM ".IMAGES_TABLE."
WHERE image_id = ".$result['cat_image'];
if ($image_row = $site_db->query_firstrow($sql))
{
if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0))
{
$cat_image = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
}
else
{
$cat_image = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
}
$file_info = @getimagesize($cat_image);
$dim = 50;
$width = $file_info[0];
$height = $file_info[1];
if ($width && $height) {
if ($width > $dim || $height > $dim) {
@$ratio = $width / $height;
if ($ratio > 1) {
$new_width = $dim;
$new_height = round(($dim/$width) * $height);
}else {
$new_width = round(($dim/$height) * $width);
$new_height = $dim;
}
}else{
$new_width = $width;
$new_height = $height;
}
}else{
$new_width = $dim;
$new_height = $dim;
}
$cat_image = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\"><img src=\"".$cat_image."\" width=\"".$new_width."\" height=\"".$new_height."\"></a> <a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$result['cat_image'])."\" target=\"_blank\">".$image_row['image_name']."</a>";
}
}
$value = $result['cat_image'];
if (isset($HTTP_POST_VARS['cat_image'])/* && $value == ""*/) {
$value = stripslashes($HTTP_POST_VARS['cat_image']);
}
echo "<tr class=\"".get_row_bg()."\">\n<td><p class=\"rowtitle\">Category image</p></td>\n<td><p><input type=\"text\" size=\"5\" name=\"cat_image\" value=\"".$value."\"> $cat_image</p></td>\n</tr>\n";
//End Category image
__________________
حســــــــــــبي الله ونعــــــــم الوكيـــــــــل
اللــــــــــهم اعنــــــــــي على شـــــــــكرك وذكــــــــرك و حســــــــن عبـــــــادتك