أهلا وسهلا بك زائرنا الكريم في منتدى دعم PBBoard الرسمي، لكي تتمكن من المشاركة ومشاهدة جميع أقسام المنتدى وكافة الميزات ، يجب عليك إنشاء حساب جديد بالتسجيل بالضغط هنا أو تسجيل الدخول اضغط هنا إذا كنت عضواً .

طلب دمج بين كودين


مشاهدة المشاركة في الموضوع بالعرض العادي
look/images/icons/i1.gif طلب دمج بين كودين
  20-11-2013 05:50 مساءً  
Soliman
معلومات الكاتب
المشاركة الأصلية كتبت بواسطة: Mr King المعذره على المداخله

ربما أستطيع التوضيح أكثر



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



ولكن الكود
CODE
<?php echo $pub_no;?>


لايتمّ استبداله برقم معرّف جوجل ادسنس في السطر

CODE
google_ad_client = pub-<?php echo $pub_no;?>;


يعني من خلال سورس الصفحه ستجد بأنّ هذا السطر لم يتغيّر



في حين أنه من المفترض أن يظهر عى هذا الشكل

CODE
google_ad_client = "pub-1111111111111111";


في الحاله الافتراضيه (في جميع المواضيع باستثناء مواضيع الأعضاء المشاركون في خدمة مشاركة الأرباح)


طلب دمج بين كودين



جيد هكذا يتم توضيح المشكلة اشكرك على التوضيح

تفضل اخي العزيز قالب show_subject.tpl المعدل لحل مشكلة عدم ظهور رقم معرّف جوجل ادسنس في السطر




CODE
<!-- action_find_addons_1 -->
{template}show_subject_information{/template}
<table align="center" border="0" cellspacing="1" class="border" width="98%" onclick="switchBlock('Options_mods')">
    <tr align="center">
        <td class="tcat" width="18%">
                {$lang['information_writer']}
        </td>
        <td class="tcat" width="82%" align="right">
        <div class="r-right">
        <img src="{$Info['icon']}" />
<span dir="{$_CONF['info_row']['content_dir']}">
{$Info['prefix_subject']}
</span>
        {if {$_CONF['info_row']['rewriterule']} == '1'}
<a href="t{$subject_id}.html">
{else}
<a href="index.php?page=topic&amp;show=1&amp;id={$subject_id}">
{/if}
{$subject_title}</a>
</div>
<div class="l-left">
{$Info['native_write_time']}
</div>
        </td>
    </tr>
    <tr align="center">
        <td class="tbar_writer_info" width="18%" valign="top">
             {if {$Info['username']}}
        <!-- Code switch Menu start -->
                <ul class="writer_controls">
                 <li>
                  <a href="javascript:switchMenuNone('{$subject_id}subjectswitch')" class="Button_secondary">
                 <?php echo $PowerBB->functions->GetwriterGroupStyle($PowerBB->_CONF['template']['Info']['username'],$PowerBB->_CONF['template']['Info']['usergroup']);?>
                 <img border="0" alt="" src="{$image_path}/menu_open.gif" /></a>
                 </li>
                 </ul>
               <div style="display:none;" class="drop_menu" id="{$subject_id}subjectswitch">
                    <div class="thead">
                     <a href="javascript:switchMenuNone('{$subject_id}subjectswitch')">
                    {if {$_CONF['info_row']['rewriterule']} == '1'}
                    <a href="u{$Info['id']}.html">
                    {else}
                    <a href="index.php?page=profile&amp;show=1&amp;id={$Info['id']}">
                    {/if}
                    {$Info['display_username']}</a>
                    </a>
                    </div>
                    <div class="menu_popup">
                    {if {$_CONF['info_row']['rewriterule']} == '1'}
                    <a href="u{$Info['id']}.html">
                    {else}
                    <a href="index.php?page=profile&amp;show=1&amp;id={$Info['id']}">
                    {/if}
                    {$lang['view_profile']}
                    </a>
                    </div>
                    <div class="menu_popup">
                        <a href="index.php?page=search&option=3&amp;username={$Info['username']}&starteronly=0&section=all&exactname=1&sort_order=DESC">
{$lang['search_for_all_posts']}
{$Info['username']}</a>
</div>
                    <div class="menu_popup">
                        <a href="index.php?page=search&option=4&amp;username={$Info['username']}&starteronly=0&section=all&exactname=1&sort_order=DESC">
{$lang['search_for_all_replys']}
{$Info['username']}</a>
</div>

                    {if {$_CONF['member_permission']}}
                    <div class="menu_popup">
                    <a href="index.php?page=pm_send&send=1&index=1&amp;username={$Info['username']}">
                  {$lang['send_a_private_message_to']}
                             {$Info['username']} </a>
                             </div>
                             {/if}
                    {if {$_CONF['member_permission']}}
                    <div class="menu_popup">
                    <a href="index.php?page=send&member=1&index=1&amp;id={$Info['id']}">
{$lang['send_a_message_to_the_mailing']}
                            {$Info['username']} </a>
                             </div>
                             {/if}
{if {$mod_edit_member}}
                {if {$_CONF['member_permission']}}
                <div class="menu_popup">
                <a target="_blank" href="admin.php?page=member&edit=1&main=1&amp;id={$Info['id']}">
{$lang['edit_member_data']}
                       {$Info['username']} </a>
                        </div>
                        {/if}
{/if}
            </div>
            <!-- Code switch Menu End -->
            {template}writer_info{/template}
            
            {if {$Awards_nm} > '0'}
            {template}awards{/template}
            {/if}
            
            {if {$_CONF['info_row']['show_list_last_5_posts_member']} == 1}
            {template}last_subject_writer{/template}
            {/if}
            {else}
            {template}guest_info{/template}
            {/if}
        </td>
        <td
        {if {$Info['special']} == '1'}
        id="layerspecial" class="td_special" width="82%" valign="top" align="right"
        {else}
        class="tbar_writer_info" width="82%" valign="top" align="right"
        {/if}
        onclick="switchBlock('subject_rating');">
               {template}add_this{/template}
               {if !{$STOP_ADSENSES_TEMPLATE}}
            {template}adsense_topic{/template}
            {/if}
<?php
$pub_no = "1111111111111111";
$member_pub = $PowerBB->_CONF['template']['Info']['extrafield_1'];
if(is_numeric($member_pub) && mb_strlen($member_pub)=='16' &&
$PowerBB->_CONF['template']['_CONF']['member_row']['username'] <> $PowerBB->_CONF['template']['Info']['username'])
{
$pub_no = $member_pub;
}
?>
<div class="text">
<?php
$inserts = "
<script type='text/javascript'>
google_ad_client = 'pub-$pub_no';
google_ad_width=300;
google_ad_height=250;
google_ad_format='300x250_as';
google_ad_type='text_image';
google_ad_channel='forum';
google_color_border='FFFFFF';
google_color_bg='FFFFFF';
google_color_link='0000FF';
google_color_text='000000';
google_color_url = '008000';
</script>
<script type='text/javascript'
src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
</script>
";
$_text = $PowerBB->_CONF['template']['Info']['text'];
$_tmp_lines = explode("", $_text);
$_tmp_pos = round(count($_tmp_lines) / 1.4)-1;
for ($_i = 0; $i < ($_count = count($_tmp_lines)); $_i++)
{
if ($_i == $_tmp_pos)
{
$_text = preg_replace('`' . preg_quote($_tmp_lines[$_i]) . '`', $_tmp_lines[$_i] . $inserts , $_text , 1);
echo $_text;
break;
}
}
?>
</div>


            {if {$Info['close_reason']} != '' and {$Info['close']} }
            
            
            
            
        <i><font color="#FF0000">
{$lang['reason_for_closure']}
        {$Info['close_reason']}</font></i>
             {/if}

            {if {$Info['attach_subject']}}
                {template}attach_show{/template}
            {/if}
           {if {$_CONF['group_info']['view_action_edit']}}
                 {if {$Info['action_by']} != ''}
                 
                 
                 <div align="center">
                 <i>
                {$lang['action_by_subject']}
                {$Info['action_by']}
                {$lang['last_date']}
                {$Info['actiondate']}
                </i>
                </div>
                
              {/if}
            {/if}
               {if {$Info['reason_edit']} != ''}
                 <div align="center">
                <b>{$lang['reason_edit']}
                {$Info['reason_edit']}</b>
                </div>
                
            {/if}
            {if {$Info['user_sig']} != ''}
                {template}signature_show{/template}
            {/if}
        </td>
    </tr>
    <tr align="center">
        <td class="row1" width="18%">
        {if {$Info['username']}}
{if {$_CONF['member_row']['username']} != {$Info['username']}}
        {if {$_CONF['info_row']['reputationallw']} == 1}
             <a href="javascript:switchMenuNone('{$subject_id}reputation')"
             title="{$lang['add_reputation_to']}
{$Info['username']}">
            <img border="0" src="{$image_path}/reputation.gif" />
            </a>
{template}subject_reputation{/template}
{/if}
{/if}
  {/if}
            <a title="{$lang['reporting_for_post']}"
             href="index.php?page=report&amp;index=1&amp;subject_id={$subject_id}">
            <img alt="{$lang['reporting_for_post']}"
            border="0" alt="" src="{$image_path}/report.gif" /></a>
        </td>
        <td  colspan="2" class="row1" width="82%">
<table border="0" width="100%" cellpadding="0" style="border-collapse: collapse">
    <tr>
    <td>
    <div class="r-right">
<!-- like facebook -->
{if {$_CONF['info_row']['active_like_facebook']} == '1'}
<div class="addthis_toolbox addthis_default_style">
<a style="border-bottom:none" class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a style="border-bottom:none" class="addthis_button_tweet"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript" src="includes/js/addthis_widget.js#username={$_CONF['info_row']['use_list']}"></script>
{/if}
<!-- / like facebook -->
<!-- action_find_addons_2 -->
</div>
<div class="l-left">
<!-- action_find_addons_3 -->
<ul class="post_controls">
{if {$_CONF['member_permission']}}
        {if !{$mod_toolbar}}
<li>
<a title="{$lang['edit_subject']}"
href="index.php?page=management&amp;subject=1&amp;section={$Info['section']}&amp;subject_id={$subject_id}&amp;operator=edit"
title="{$lang['edit_subject']}" class="Button_secondary">
{$lang['edit_subject']}</a>
</li>
<li>
<a href="javascript:delete_post('index.php?page=management&amp;subject=1&amp;section={$Info['section']}&amp;subject_id={$subject_id}&amp;operator=delete')"
title="{$lang['delete_subject']}" class="Button_secondary">
{$lang['delete_subject']}</a>
</li>
{else}
{if {$Info['close']} == '0'}
{if {$timeout}}
{if {$_CONF['member_row']['username']} == {$Info['username']}}
{if {$_CONF['group_info']['edit_own_subject']}}
<li>
<a title="{$lang['edit_subject']}"
href="index.php?page=management&amp;subject=1&amp;section={$Info['section']}&amp;subject_id={$subject_id}&amp;operator=edit" class="Button_secondary">
{$lang['edit_subject']}</a>
</li>
{/if}
{if {$_CONF['group_info']['del_own_subject']}}
<li>
<a href="javascript:delete_post('index.php?page=management&amp;subject=1&amp;section={$Info['section']}&amp;subject_id={$subject_id}&amp;operator=delete')"
title="{$lang['delete_subject']}" class="Button_secondary">
{$lang['delete_subject']}</a>
</li>
   {/if}
{/if}
{/if}
{/if}
{/if}
{/if}
<li>
<a href="index.php?page=new_reply&amp;index=1&amp;id={$subject_id}{$password}
&amp;qu_Subject={$subject_id}&amp;
user={$Info['username']}" title="{$lang['qu_subject']}" class="Button_secondary">
{$lang['quote']}</a>
</li>
<li>
<?php $post_id = $PowerBB->_CONF['template']['subject_id']; ?>
<a class="img-submit" id="mad_<?php echo "$post_id"; ?>" name="mad_<?php echo "$post_id"; ?>" onclick="multiquote_add(<?php echo "$post_id"; ?>); return false;" href="#">{$lang['multiquote']}</a>
</li>
<!-- action_find_addons_4 -->
</ul>
</div>

</td>
    </tr>
</table>
        </td>
    </tr>
</table>

<!-- action_find_addons_5 -->









او اعد قالب show_subject.tpl لأصلة



ثم ابحث عن :


CODE
<div class="text">{$Info['text']}</div>




واستبدله بـ :

CODE
<?php
$pub_no = "1111111111111111";
$member_pub = $PowerBB->_CONF['template']['Info']['extrafield_1'];
if(is_numeric($member_pub) && mb_strlen($member_pub)=='16' &&
$PowerBB->_CONF['template']['_CONF']['member_row']['username'] <> $PowerBB->_CONF['template']['Info']['username'])
{
$pub_no = $member_pub;
}
?>
<div class="text">
<?php
$inserts = "
<script type='text/javascript'>
google_ad_client = 'pub-$pub_no';
google_ad_width=300;
google_ad_height=250;
google_ad_format='300x250_as';
google_ad_type='text_image';
google_ad_channel='forum';
google_color_border='FFFFFF';
google_color_bg='FFFFFF';
google_color_link='0000FF';
google_color_text='000000';
google_color_url = '008000';
</script>
<script type='text/javascript'
src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
</script>
";
$_text = $PowerBB->_CONF['template']['Info']['text'];
$_tmp_lines = explode("", $_text);
$_tmp_pos = round(count($_tmp_lines) / 1.4)-1;
for ($_i = 0; $i < ($_count = count($_tmp_lines)); $_i++)
{
if ($_i == $_tmp_pos)
{
$_text = preg_replace('`' . preg_quote($_tmp_lines[$_i]) . '`', $_tmp_lines[$_i] . $inserts , $_text , 1);
echo $_text;
break;
}
}
?>
</div>




بالتوفيق


تم تحرير المشاركة بواسطة :Soliman بتاريخ:20-11-2013 05:54 مساءً



الساعة الآن 08:23 AM