المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : استخدامات متغيرات سمارتي smarty في قوالب زووبس xoops



Chakira
11-01-2013, بتوقيت غرينيتش 07:14 AM
بسم الله الرحمن الرحيم
والصلاة و السلام على سيدنا محمد و آله و صحبه و إخوانه و حزبه

بداية عيد مبارك عليكم جميعا أسأل الله أن يعيده على الأمة الإسلامية و على إخواننا في فلسطين بالنصر

ثم أعتذر عن غيابي الاخير بسبب المرض و الحمد لله بدأت أتعافى منه رغم عدم قدرتي على
القعود فترة طويلة امام الجهاز

***

شرح طريقة اليوم يهم قوالب مجلة زووبس الشهيرة و المعروفة بحمايتها القوية

أولا : لأخذ فكرة عن السمارتي يرجى زيارة الموقع www.smarty.net (http://www.smarty.net)

بصراحة موضوع السمارتي ممتع و يسهل عملية التعديل لهذا نجد برمجيات عديدة تستخدمه مثل زووبس و دروبال

و هذه مجموعة من البرمجيات تستخدمه حسب موقع سمارتي :
رمز Code:
# XULit! # OurCMS # WebGenerator-X # XOOPS CMS # Open Publisher # Tiki CMS/Groupware # TIS # PHPEngine # CMS Drupal # Exponent # CMS Made Simple # PostNuke CMS # XS2 # Edit-X # CoolerServer # Bitweaver.org # Serendipity # phpSQLiteCMS # bigace
***

نرجع لزووبس http://www.dzbatna.com/images/smilies/cupidarrow.gif و استخدامات متغيرات smarty داخل القوالب themes
وهذه جملة joomla من المتغيرات مع شرح طريقة وظيفتها :


متغير يعرض تاريخ مختصر
رمز PHP:

<code style="white-space:nowrap"> <code> <{$smarty.now|date_format:"%a, %b %e, %Y | %H:%M %Z"}>
</code> </code>

</span>


متغير يعرض التاريخ بشكل مفصل
رمز PHP:

<code style="white-space:nowrap"> <code> <{$smarty.now|date_format:"%A, %B %e, %Y | %H:%M %Z"}>
</code> </code>

لاستخدام كود code بي اتش بي في قالب template زووبس
رمز PHP:

<code style="white-space:nowrap"> <code> <{php}>
ضع كود code البي اتش بي هنا
<{/php}>
</code> </code>

لإدراج الترميز مثل UTF-8 أو iso-8859-1 و غيرهما
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_charset}>
</code> </code>

لتحديد اللغة مثل ar او en
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_langcode}>
</code> </code>

إدراج الكلمات المفتاحية
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_meta_keywords}>
</code> </code>

لإدراج وصف الصفحات
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_meta_description}>
</code> </code>

لوضح الحقوق على القالب template
رمز PHP:

<code style="white-space:nowrap"> <code> <{$meta_copyright}>
</code> </code>

متغير إدراج معلومات المحرك W3C
رمز PHP:

<code style="white-space:nowrap"> <code> <{$meta_robots}>
</code> </code>

إدراج اسم الموقع
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_sitename}>
</code> </code>

إدراج عنوان الصفحة
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_pagetitle}>
</code> </code>

اسم القالب template المستخدم على زووبس و الذي يوجد داخل مجلد themes مثل قالب template default مثلا او xt2
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_theme}>
</code> </code>

إدراج ملف الستايل style شيت للقالب template المستخدم
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_themecss}>
</code> </code>

لإدراج رابط الموقع مثل : www.dzbatna.net (http://www.dzbatna.net) أو www.annasseh.com (http://www.annasseh.com)
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_url}>
</code> </code>

لإدراج الجافا
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_js}>
</code> </code>

لعرض البنرات على القالب template
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_banner}>
</code> </code>

كود code عرض بلوكات اليسار
رمز PHP:

<code style="white-space:nowrap"> <code> <{foreach item=block from=$xoops_lblocks}>
<{$block}>
<{/foreach}>
</code> </code>

كود code عرض بلوك منتصف المنتصف
رمز PHP:

<code style="white-space:nowrap"> <code> <{foreach item=block from=$xoops_ccblocks}>
<{$block}>
<{/foreach}>
</code> </code>

كود code عرض بلوك يسار المنتصف
رمز PHP:

<code style="white-space:nowrap"> <code> <{foreach item=block from=$xoops_clblocks}>
<{$block}>
<{/foreach}>
</code> </code>

كود code عرض بلوك يمين المنتصف
رمز PHP:

<code style="white-space:nowrap"> <code> <{foreach item=block from=$xoops_crblocks}>
<{$block}>
<{/foreach}>
</code> </code>

متغير عرض الأخبار و المحتويات
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_contents}>
</code> </code>

التأكد من شرط عرض بلوكات المنتصف بلوحة تحكم زووبس
رمز PHP:

<code style="white-space:nowrap"> <code> <{if $xoops_showcblock == 1}>
</code> </code>

للتأكد من شرط عرض بلوكات اليمين هل هو متوفر ام لا
رمز PHP:

<code style="white-space:nowrap"> <code> <{if $xoops_showrblock == 1}>
</code> </code>

كود code عرض بلوكات اليمين
رمز PHP:

<code style="white-space:nowrap"> <code> <{foreach item=block from=$xoops_rblocks}>
<{$block}>
<{/foreach}>
</code> </code>

لعرض الفوتر
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_footer}>
</code> </code>

عرض شيء معين للمدير فقط
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_isadmin}>
</code> </code>

عرض شيء معين للمسجلين فقط
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_isuser}>
</code> </code>

لعرض معرف العضو
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_userid}>
</code> </code>

عرض اسم العضو
رمز PHP:

<code style="white-space:nowrap"> <code> <{$xoops_uname}>
</code> </code>

و اليكم مثال عن كود code ملف theme.html للقالب template يحتوي بعضا من هذه المتغيرات للمزيد من التوضيح :

رمز PHP:

<code style="white-space:nowrap"> <code> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
<head>
<meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" />
<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
<meta name="robots" content="<{$xoops_meta_robots}>" />
<meta name="keywords" content="<{$xoops_meta_keywords}>" />
<meta name="description" content="<{$xoops_meta_description}>" />
<meta name="rating" content="<{$xoops_meta_rating}>" />
<meta name="author" content="<{$xoops_meta_author}>" />
<meta name="copyright" content="<{$xoops_meta_copyright}>" />
<meta name="generator" content="XOOPS" />
<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/xoops.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_themecss}>" />
<!-- RMV: added module header -->
</head><body><{$xoops_module_header}>
<script type="text/javascript">
<!--
<{$xoops_js}>
//-->
</script>
<table dir=rtl cellspacing="0">
<tr id="header">
<div align="center">
<table id="Table_01" width="100%" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>



<td width="255" background="<{$xoops_imageurl}>images/index_02.gif">
<img src="<{$xoops_imageurl}>images/index_03.gif" width="255" height="120" alt="" align="left" hspace="0"></td>
<td background="<{$xoops_imageurl}>images/index_02.gif" align="center">
&nbsp;
</td>
<td width="444" background="<{$xoops_imageurl}>images/index_02.gif">
<img src="<{$xoops_imageurl}>images/index_01.gif" width="444" height="120" alt="" align="right" hspace="0"></td>
</tr>
</table>

<table dir=rtl cellspacing="0">
<tr>
<td id="rightcolumn" rowspan="2">
<!-- Start right blocks loop -->
<{foreach item=block from=$xoops_lblocks}>
<{include file="default/theme_blockleft.html"}>
<{/foreach}>
<!-- End right blocks loop -->

</td>

<td id="centercolumn">
<!-- Display center blocks if any -->
<{if $xoops_showcblock == 1}>
<table dir=rtl cellspacing="0">
<tr>
<td id="centerCcolumn" colspan="2">
<!-- Start center-center blocks loop -->
<{foreach item=block from=$xoops_ccblocks}>
<{include file="default/theme_blockcenter_c.html"}>
<{/foreach}>
<!-- End center-center blocks loop -->
</td>
</tr>
<tr>
<td id="centerLcolumn">
<!-- Start center-left blocks loop -->
<{foreach item=block from=$xoops_clblocks}>
<{include file="default/theme_blockcenter_l.html"}>
<{/foreach}>
<!-- End center-left blocks loop -->
</td>
<td id="centerRcolumn">
<!-- Start center-right blocks loop -->
<{foreach item=block from=$xoops_crblocks}>
<{include file="default/theme_blockcenter_r.html"}>
<{/foreach}>
<!-- End center-right blocks loop -->
</td>
</tr>
</table>
<{/if}>
<!-- End display center blocks -->
<div dir=rtl id="content">
<{$xoops_contents}>
</div>
<{if $xoBlocks.page_bottomleft or $xoBlocks.page_bottomright or $xoBlocks.page_bottomcenter}>
<table dir=rtl cellspacing="0">
<{if $xoBlocks.page_bottomcenter}>
<tr><td id="bottomCcolumn" colspan="2">
<{foreach from=$xoBlocks.page_bottomcenter item=block}><{include file="default/theme_blockcenter_c.html"}><{/foreach}>
</td>
</tr>
<{/if}>
<{if $xoBlocks.page_bottomleft or $xoBlocks.page_bottomright}>
<tr>
<td id="bottomLcolumn">
<{foreach from=$xoBlocks.page_bottomleft item=block}><{include file="default/theme_blockcenter_l.html"}><{/foreach}>
</td>
<td id="bottomRcolumn">
<{foreach from=$xoBlocks.page_bottomright item=block}><{include file="default/theme_blockcenter_r.html"}><{/foreach}>
</td>
</tr>
<{/if}>
</table>
<{/if}>
</td>
<{if $xoops_showrblock == 1}>

<td id="leftcolumn" rowspan="2">
<!-- Start left blocks loop -->
<{foreach item=block from=$xoops_rblocks}> <{include file="default/theme_blockright.html"}>
<{/foreach}>
<!-- End left blocks loop -->
</td>
<{/if}>
</tr>
<tr>

<td id="centercolumn">
<p align="center">&nbsp;<{$xoops_banner}></td>
</tr>
</table>

<table dir=rtl cellspacing="0">
<tr id="footerbar">
<div align="center">
<table id="Table_01" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="255" background="<{$xoops_imageurl}>images/footer_02.gif">
<p align="center">
<img src="<{$xoops_imageurl}>images/footer_03.gif" width="255" height="36" alt="" align="left" hspace="0"></td>
<td background="<{$xoops_imageurl}>images/footer_02.gif" align="center">
&nbsp;</td>
<td width="444" background="<{$xoops_imageurl}>images/footer_02.gif">
<img src="<{$xoops_imageurl}>images/footer_01.gif" width="444" height="36" alt="" align="right" hspace="0"></td>
</tr>
</table>
</div>
</tr>
</table>
</body>
</html>
</code> </code>

أتمنى ان يكون الشرح طريقة واضحا و مفيدا و السموحة ان كان فيه اطالة
ترقبوا المزيد من الشروحات حول زووبس (للمطورين و المصممين و ليس شروحات الاستخدام)

مثال قالب template لمجلة زووبس جاري الانتهاء منه :

http://img340.imageshack.us/img340/7989/localhostscreencapture2.png


دعواتكم

أخوكم الناصح




https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/482113_236967293114455_1193518507_n.png (http://www.dzbatna.com)
©المشاركات المنشورة تعبر عن وجهة نظر صاحبها فقط، ولا تُعبّر بأي شكل من الأشكال عن وجهة نظر إدارة المنتدى (http://www.dzbatna.com)©

استعمل مربع البحث في الاسفل لمزيد من المواضيع


سريع للبحث عن مواضيع في المنتدى