მოკლე აღწერის გამოტანის მოდიფიკაცია » Georgian Webmasters Portal
ჩვენი გამოკითხვა
მოგწონთ საიტი ??
სულ უპასუხა: 85
სტატისტიკა
სულ ონლაინში: 1
სტუმარი: 1
მომხმარებელი: 0
რეკლამა საიტზე


რეკლამა საიტზე
06/11/13
Tags

ამ მოდიფიკაციის დაყენების შემდეგ, მომხმარებელს შეეძლება მოკლე აღწერის გამოტანის მოდიფიცირება: გამოტანა სიად, სურათებით, ან სტანდარტული სახით.
ინსტრუქცია: 

main.tpl -ში ჩასვით 


[code][aviable=main]  

<script type="text/javascript">  

$(function(){ 

  if($.cookie('short_template')){ 

  $(".templtes").removeClass('current'); 

  $(".templater a[data-template]").removeClass('current').each(function(){ 

  if($(this).data('template')==$.cookie('short_template')){ 

  $(this).addClass('current'); 

  $(".template-"+$.cookie('short_template')).addClass('current'); 

  } 

  }); 

  } 

  $(".templater a[data-template]").click(function(){ 

  if($(this).hasClass('current')) return false; 

  $(this).addClass('current').siblings().removeClass('current'); 

  $(".templtes").removeClass('current'); 

  $(".template-"+$(this).data('template')).addClass('current'); 

  $.cookie('short_template', $(this).data('template'),{path:'/'}); 

  window.location.href=dle_root+'?short_template'+$(this).data('template');  

  return false; 

  }); 

})  

   

</script>  

   

  <div class="sortn dpad"><div class="sortn"><div class="templater">Режим просмотра: <a href="#" class="current" data-template="default">Стандарт</a> | <a href="#" data-template="list">Список</a> | <a href="#" data-template="icons">Иконки</a></div></div></div>  

  [/aviable]
[/code]

დავამატოთ სტილები: 

[code].templater .current{color:#c00;} 

.templtes{display:none;} 

.templtes.current{display:block;}[/code]

გადმოწერეთ არქივი და გაწერეთ: jquery.cookie.js თქვენ არ შეგიძლიათ ფაილების გადმოწერა სერვერიდან 

[code]<script type="text/javascript" src="{THEME}/js/jquery.cookie.js"></script> 
[/code]

გავხსნათ ფაილი engine/modules/show.short.php 

ვაკომენტარებთ სტრიქონს: 

/* if( isset( $view_template ) and $view_template == "rss" ) { 

  } elseif( $category_id and $cat_info[$category_id]['short_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['short_tpl'] . '.tpl' ); 

  else $tpl->load_template( 'shortstory.tpl' ); */

მის ქვევით ვსვავთ: 

$user_short_tpl = array( 

'default' => 'shortstory.tpl', //дефолтный шаблон 

'list' => 'shortstory_list.tpl', // шаблон списком 

'icons' => 'shortstory_icons.tpl' // шаблон картинки 

); 

$user_tpl =(isset($_COOKIE['short_template']) && isset($user_short_tpl[$_COOKIE['short_template']])) ? $user_short_tpl[$_COOKIE['short_template']] : $user_short_tpl['default']; 

$user_tpl = (isset($_GET['short_template']) && isset($user_short_tpl[$_GET['short_template']])) ? $user_short_tpl[$_GET['short_template']] : $user_tpl; 

if( isset( $view_template ) and $view_template == "rss" ) { 

} elseif( $category_id and $cat_info[$category_id]['short_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['short_tpl'] . '.tpl' ); 

else $tpl->load_template($user_tpl);







კომენტარის დამატება

სულ კომენტარები: 0


gelesson.net/js/geo.js" mce_src="geo.js" type="text/javascript">
კომენტარის დამატება
სახელი *:
კოდი *:


ვცდილობთ დავიცვათ სავტორო უფლებები :)
დიზაინი სპეციალურად თარგმნა ვანიკომ WebDles.Ucoz.Net - ის თვის Site By Vaniko

Website builder - uCoz Check Google Page Rank