Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

ROZWIĄZANY: loop wstawienie belki


Nitrous

Rekomendowane odpowiedzi

witam

Chciałbym dodać belke np po drugiej kategorii znalazłem sekcje gdzie dodać kod, ale problem się pojawia w loopowaniu kiedy dodac to pokazuje mi sie w wszystkich kategoriach, jest jakiś sposób aby to ominąć?

a dokładnie o coś takiego mi chodzi:

2rrb4t5.jpg

<div class="category_block block_wrap" id="">
	<if test="cats_forums:|:is_array( $cat_data ) AND count( $cat_data )">
		<foreach loop="categories:$cat_data as $_data">
			<if test="cat_has_forums:|:is_array( $_data['forum_data'] ) AND count( $_data['forum_data'] )">
				{parse striping="catTable" classes="row1,row2"}
				<div class='category_block block_wrap'>
					{parse replacement="header_start"}<h3 id='category_{$_data['cat_data']['id']}' class='maintitle'><a class='toggle right' href='#' title="{$this->lang->words['toggle_cat']}">{$this->lang->words['toggle_cat']}</a> <a href="{parse url="showforum={$_data['cat_data']['id']}" seotitle="{$_data['cat_data']['name_seo']}" template="showforum" base="public"}" title='{$this->lang->words['view_cat']}'>{$_data['cat_data']['name']}</a></h3>{parse replacement="header_end"}
					<table cellspacing='0' class='ipb_table' summary="{$this->lang->words['forums_in_cat']} '{$_data['cat_data']['name']}'">
						<tr class='header'>
							<th scope='col' class='col_c_icon'> </th>
							<th scope='col' class='col_c_forum'>{$this->lang->words['cat_name']}</th>
							<th scope='col' class='col_c_stats stats'>{$this->lang->words['stats']}</th>
							<th scope='col' class='col_c_post'>{$this->lang->words['last_post_info']}</th>
						</tr>
						<!-- / CAT HEADER -->
						<foreach loop="forums:$_data['forum_data'] as $forum_id => $forum_data">
							<if test="forumRedirect:|:$forum_data['redirect_on']">
								<tr class='{parse striping="catTable"} redirect_forum'>
									<td class='altrow'>{parse replacement="f_redirect"}</td>
									<td>
										<h4><a href="{parse url="showforum={$forum_data['id']}" seotitle="{$forum_data['name_seo']}" template="showforum" base="public"}" title='{$this->lang->words['go_to_forum']}'>{$forum_data['name']}</a></h4>
										<p class='desc' style='padding-top: 3px;'>{$forum_data['description']}</p>
									</td>
									<td colspan='2'>
										{$this->lang->words['rd_hits']}: {parse format_number="$forum_data['redirect_hits']"}
									</td>
								</tr>
							<else />
								<tr class='{parse striping="catTable"}'>
									<td class='altrow'>
										<if test="unreadicon:|:$forum_data['img_new_post'] != 'f_locked' && strstr( $forum_data['img_new_post'], 'unread' )">
											<a id='forum_img_{$forum_data['id']}' href="{parse url="app=forums&module=forums&section=markasread&marktype=forum&forumid={$forum_data['id']}&returntoforumid={$this->request['f']}&i=1" base="public"}" title="{$this->lang->words['bi_markread']}" class='forum_marker'>
												                                             <if test="$forum_data['icon'] != '' AND $forum_data['icon'] !='0'">
							             <center><img src='{$this->settings['board_url']}/public/forumicons/{$forum_data['icon']}.gif' /></center>
							             <else />											
							                												<if test="$forum_data['icon'] != '' AND $forum_data['icon'] !='0'">
	<center><img src='{$this->settings['board_url']}/public/forumicons/{$forum_data['icon']}_off.gif' /></center>
											<else />
													{parse replacement="{$forum_data['img_new_post']}"}										
											</if>													
												</if>

											</a>

											<script type='text/javascript'>
												ipb.global.registerMarker( "forum_img_{$forum_data['id']}", "{$forum_data['img_new_post']}", markerURL + "&forumid={$forum_data['id']}" );
											</script>
										<else />
																							<if test="$forum_data['icon'] != '' AND $forum_data['icon'] !='0'">
	<center><img src='{$this->settings['board_url']}/public/forumicons/{$forum_data['icon']}_off.gif' /></center>
											<else />
													{parse replacement="{$forum_data['img_new_post']}"}										
											</if>													
												</if>
									</td>
									<td>
										<h4><a href="{parse url="showforum={$forum_data['id']}" seotitle="{$forum_data['name_seo']}" template="showforum" base="public"}" title='{$this->lang->words['go_to_forum']}'>{$forum_data['name']}</a></h4>
										<p class='desc' style='padding-top: 3px;'>{$forum_data['description']}</p>

										<if test="showSubForums:|:$forum_data['show_subforums'] AND count( $forum_data['subforums'] ) AND $forum_data['show_subforums']">
											<h5 class='hide'>{$this->lang->words['subforums']}</h5>
											<ol class='subforums' id='subforums_{$forum_data['id']}'>
											<foreach loop="subforums:$forum_data['subforums'] as $__id => $__data">
												<if test="showSubForumsLit:|:$__data[3]"><li class='newposts'><else /><li></if><a href="{parse url="showforum={$__data[0]}" seotitle="{$__data[2]}" template="showforum" base="public"}" title='{$this->lang->words['go_to_forum']}'>{$__data[1]}</a></li>
											</foreach>
											</ol>
										</if>
										<!-- Skinnote: Clean up queued stuff -->
										<if test="hasQueuedAndCanSeeIcon:|:!empty($forum_data['_has_queued_and_can_see_icon'])">
											<em class='moderated'><a href='{parse url="showforum={$forum_data['id']}&modfilter=all" seotitle="{$forum_data['name_seo']}" template="showforum" base="public"}' title='{$this->lang->words['view_unapproved']}'>{parse expression="sprintf( $this->lang->words['f_queued'], $forum_data['queued_topics'], $forum_data['queued_posts'])"}</a></em>
										</if>
									</td>
									<td class='altrow stats'>
										<ul>
											<li>{$forum_data['topics']} {$this->lang->words['topics']}</li>
											<li>{$forum_data['posts']} {$this->lang->words['replies']}</li>
										</ul>
									</td>
									<td nowrap='nowrap'>
										<ul class='last_post'>
											<if test="hideLastInfo:|:$forum_data['hide_last_info']">
												<li>{$this->lang->words['f_protected']}</li>
											<else />

												<li>
                                                   	<strong>{$this->lang->words['in']} {$forum_data['last_topic_title']}</strong>
                                                   </li>
                                                   <li>
                                                   {$this->lang->words['by']} 
													<if test="lastPosterName:|:isset($forum_data['last_poster_name']) AND $forum_data['last_poster_name']">
														<if test="lastPosterID:|:$forum_data['last_poster_id']">
															<a href='{parse url="showuser={$forum_data['last_poster_id']}" template="showuser" seotitle="{$forum_data['seo_last_name']}" base="public"}' title='{$this->lang->words['view_profile']}'>{$forum_data['last_poster_name']}</a>{parse template="user_popup" group="global" params="$forum_data['last_poster_id'], $forum_data['seo_last_name']"}
														<else />
															{$this->settings['guest_name_pre']}{$forum_data['last_poster_name']}{$this->settings['guest_name_suf']}
														</if>
													<else />
														{$this->lang->words['f_none']}
													</if>
                                                   <if test="hideDateUrl:|:$forum_data['_hide_last_date']">
													<span class='topic_date'>{parse date="$forum_data['last_post']" format="LONG"}</span>
												<else />
													<span class='topic_date'><a href='{parse url="showtopic={$forum_data['last_id']}&view=getlastpost" base="public" template="showtopic" seotitle="{$forum_data['seo_last_title']}"}' title='{$this->lang->words['view_last_post']}'>{parse date="$forum_data['last_post']" format="LONG"}</a></span>
												</if>
                                                   </li>
											</if>
										</ul>
									</td>
								</tr>
							</if>
						</foreach>
					</table>{parse replacement="box_end"}
				</div>
			</if>
		</foreach>
	</if>
</div>
</div>

Edytowane przez Nitrous
Odnośnik do komentarza
Udostępnij na innych stronach

<div class="maintitle_base"><div class="header_left"><div class="header_right"><h3 class="maintitle"> <a href="" title="Wyświetl kategorię">
Reklama</a>
tutaj bedzie kod reklamy flash
</div></h3></div></div></div>

w pierwszym poscie dodalem tą całą sekcje.

Edytowane przez Nitrous
Odnośnik do komentarza
Udostępnij na innych stronach

<div class="category_block block_wrap" id="">
               <if test="cats_forums:|:is_array( $cat_data ) AND count( $cat_data )">
                       <foreach loop="categories:$cat_data as $_data">
                               <if test="cat_has_forums:|:is_array( $_data['forum_data'] ) AND count( $_data['forum_data'] )">
                                       {parse striping="catTable" classes="row1,row2"}
                                       <div class='category_block block_wrap'>
                                               {parse replacement="header_start"}<h3 id='category_{$_data['cat_data']['id']}' class='maintitle'><a class='toggle right' href='#' title="{$this->lang->words['toggle_cat']}">{$this->lang->words['toggle_cat']}</a> <a href="{parse url="showforum={$_data['cat_data']['id']}" seotitle="{$_data['cat_data']['name_seo']}" template="showforum" base="public"}" title='{$this->lang->words['view_cat']}'>{$_data['cat_data']['name']}</a></h3>{parse replacement="header_end"}
                                               <table cellspacing='0' class='ipb_table' summary="{$this->lang->words['forums_in_cat']} '{$_data['cat_data']['name']}'">
                                                       <tr class='header'>
                                                               <th scope='col' class='col_c_icon'> </th>
                                                               <th scope='col' class='col_c_forum'>{$this->lang->words['cat_name']}</th>
                                                               <th scope='col' class='col_c_stats stats'>{$this->lang->words['stats']}</th>
                                                               <th scope='col' class='col_c_post'>{$this->lang->words['last_post_info']}</th>
                                                       </tr>
                                                       <!-- / CAT HEADER -->
                                                       <foreach loop="forums:$_data['forum_data'] as $forum_id => $forum_data">
                                                               <if test="forumRedirect:|:$forum_data['redirect_on']">
                                                                       <tr class='{parse striping="catTable"} redirect_forum'>
                                                                               <td class='altrow'>{parse replacement="f_redirect"}</td>
                                                                               <td>
                                                                                       <h4><a href="{parse url="showforum={$forum_data['id']}" seotitle="{$forum_data['name_seo']}" template="showforum" base="public"}" title='{$this->lang->words['go_to_forum']}'>{$forum_data['name']}</a></h4>
                                                                                       <p class='desc' style='padding-top: 3px;'>{$forum_data['description']}</p>
                                                                               </td>
                                                                               <td colspan='2'>
                                                                                       {$this->lang->words['rd_hits']}: {parse format_number="$forum_data['redirect_hits']"}
                                                                               </td>
                                                                       </tr>
                                                               <else />
                                                                       <tr class='{parse striping="catTable"}'>
                                                                               <td class='altrow'>
                                                                                       <if test="unreadicon:|:$forum_data['img_new_post'] != 'f_locked' && strstr( $forum_data['img_new_post'], 'unread' )">
                                                                                               <a id='forum_img_{$forum_data['id']}' href="{parse url="app=forums&module=forums&section=markasread&marktype=forum&forumid={$forum_data['id']}&returntoforumid={$this->request['f']}&i=1" base="public"}" title="{$this->lang->words['bi_markread']}" class='forum_marker'>
                                                                                                                                                    <if test="$forum_data['icon'] != '' AND $forum_data['icon'] !='0'">
                                                                            <center><img src='{$this->settings['board_url']}/public/forumicons/{$forum_data['icon']}.gif' /></center>
                                                                            <else />                                                                                   
                                                                                                                                                                               <if test="$forum_data['icon'] != '' AND $forum_data['icon'] !='0'">
               <center><img src='{$this->settings['board_url']}/public/forumicons/{$forum_data['icon']}_off.gif' /></center>
                                                                                               <else />
                                                                                                               {parse replacement="{$forum_data['img_new_post']}"}                                                                             
                                                                                               </if>                                                                                                   
                                                                                                       </if>

                                                                                               </a>

                                                                                               <script type='text/javascript'>
                                                                                                       ipb.global.registerMarker( "forum_img_{$forum_data['id']}", "{$forum_data['img_new_post']}", markerURL + "&forumid={$forum_data['id']}" );
                                                                                               </script>
                                                                                       <else />
                                                                                                                                                                                               <if test="$forum_data['icon'] != '' AND $forum_data['icon'] !='0'">
               <center><img src='{$this->settings['board_url']}/public/forumicons/{$forum_data['icon']}_off.gif' /></center>
                                                                                               <else />
                                                                                                               {parse replacement="{$forum_data['img_new_post']}"}                                                                             
                                                                                               </if>                                                                                                   
                                                                                                       </if>
                                                                               </td>
                                                                               <td>
                                                                                       <h4><a href="{parse url="showforum={$forum_data['id']}" seotitle="{$forum_data['name_seo']}" template="showforum" base="public"}" title='{$this->lang->words['go_to_forum']}'>{$forum_data['name']}</a></h4>
                                                                                       <p class='desc' style='padding-top: 3px;'>{$forum_data['description']}</p>

                                                                                       <if test="showSubForums:|:$forum_data['show_subforums'] AND count( $forum_data['subforums'] ) AND $forum_data['show_subforums']">
                                                                                               <h5 class='hide'>{$this->lang->words['subforums']}</h5>
                                                                                               <ol class='subforums' id='subforums_{$forum_data['id']}'>
                                                                                               <foreach loop="subforums:$forum_data['subforums'] as $__id => $__data">
                                                                                                       <if test="showSubForumsLit:|:$__data[3]"><li class='newposts'><else /><li></if><a href="{parse url="showforum={$__data[0]}" seotitle="{$__data[2]}" template="showforum" base="public"}" title='{$this->lang->words['go_to_forum']}'>{$__data[1]}</a></li>
                                                                                               </foreach>
                                                                                               </ol>
                                                                                       </if>
                                                                                       <!-- Skinnote: Clean up queued stuff -->
                                                                                       <if test="hasQueuedAndCanSeeIcon:|:!empty($forum_data['_has_queued_and_can_see_icon'])">
                                                                                               <em class='moderated'><a href='{parse url="showforum={$forum_data['id']}&modfilter=all" seotitle="{$forum_data['name_seo']}" template="showforum" base="public"}' title='{$this->lang->words['view_unapproved']}'>{parse expression="sprintf( $this->lang->words['f_queued'], $forum_data['queued_topics'], $forum_data['queued_posts'])"}</a></em>
                                                                                       </if>
                                                                               </td>
                                                                               <td class='altrow stats'>
                                                                                       <ul>
                                                                                               <li>{$forum_data['topics']} {$this->lang->words['topics']}</li>
                                                                                               <li>{$forum_data['posts']} {$this->lang->words['replies']}</li>
                                                                                       </ul>
                                                                               </td>
                                                                               <td nowrap='nowrap'>
                                                                                       <ul class='last_post'>
                                                                                               <if test="hideLastInfo:|:$forum_data['hide_last_info']">
                                                                                                       <li>{$this->lang->words['f_protected']}</li>
                                                                                               <else />

                                                                                                       <li>
                                                       <strong>{$this->lang->words['in']} {$forum_data['last_topic_title']}</strong>
                                                   </li>
                                                   <li>
                                                   {$this->lang->words['by']} 
                                                                                                               <if test="lastPosterName:|:isset($forum_data['last_poster_name']) AND $forum_data['last_poster_name']">
                                                                                                                       <if test="lastPosterID:|:$forum_data['last_poster_id']">
                                                                                                                               <a href='{parse url="showuser={$forum_data['last_poster_id']}" template="showuser" seotitle="{$forum_data['seo_last_name']}" base="public"}' title='{$this->lang->words['view_profile']}'>{$forum_data['last_poster_name']}</a>{parse template="user_popup" group="global" params="$forum_data['last_poster_id'], $forum_data['seo_last_name']"}
                                                                                                                       <else />
                                                                                                                               {$this->settings['guest_name_pre']}{$forum_data['last_poster_name']}{$this->settings['guest_name_suf']}
                                                                                                                       </if>
                                                                                                               <else />
                                                                                                                       {$this->lang->words['f_none']}
                                                                                                               </if>
                                                   <if test="hideDateUrl:|:$forum_data['_hide_last_date']">
                                                                                                               <span class='topic_date'>{parse date="$forum_data['last_post']" format="LONG"}</span>
                                                                                                       <else />
                                                                                                               <span class='topic_date'><a href='{parse url="showtopic={$forum_data['last_id']}&view=getlastpost" base="public" template="showtopic" seotitle="{$forum_data['seo_last_title']}"}' title='{$this->lang->words['view_last_post']}'>{parse date="$forum_data['last_post']" format="LONG"}</a></span>
                                                                                                       </if>
                                                   </li>
                                                                                               </if>
                                                                                       </ul>
                                                                               </td>
                                                                       </tr>
                                                               </if>
                                                       </foreach>
                                               </table>{parse replacement="box_end"}
                                       </div>
<div class="maintitle_base"><div class="header_left"><div class="header_right"><h3 class="maintitle"> <a href="" title="Wyświetl kategorię">
Reklama</a>
tutaj bedzie kod reklamy flash
<br />
<br />
</div></h3></div></div>
                               </if>
                       </foreach>
               </if>
       </div>
</div>

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

To może:

<if test="$_data['cat_data']['id'] == X">
<div class="maintitle_base"><div class="header_left"><div class="header_right"><h3 class="maintitle"> <a href="" title="Wyświetl kategorię">
Reklama</a>
tutaj bedzie kod reklamy flash
</div></h3></div></div></div>
</if>

Gdzie X to ID tejże kategorii..

  • Lubię to 1

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

Problem ROZWIĄZANY. Jeśli są jakiekolwiek wątpliwości, pytania proszę o założenie nowego tematu.

Wszelkie uzasadnione reklamacje/pretensje/sugestie/rady przyjmuje ekipa forum.

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.