Как установить код счетчика

Автор Volk, 09 января 2009, 01:27:13

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

Volk

Как установить код счетчика в в любую тему? При попытке поставить пишет ошибка

<!-- begin of Top100 code -->
<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?514982"></script><noscript><img src="http://counter.rambler.ru/top100.cnt?514982" alt="" width="1" height="1" border="0"></noscript>
<!-- end of Top100 code -->
<!-- begin of Top100 logo -->
<a href="http://top100.rambler.ru/top100/"><img src="http://top100-images.rambler.ru/top100/banner-88x31-rambler-black2.gif" alt="Rambler's Top100" width="88" height="31" border="0" /></a>
<!-- end of Top100 logo -->

digger®


?>
<!-- begin of Top100 code -->
<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?514982"></script><noscript><img src="http://counter.rambler.ru/top100.cnt?514982" alt="" width="1" height="1" border="0"></noscript>
<!-- end of Top100 code -->
<!-- begin of Top100 logo -->
<a href="http://top100.rambler.ru/top100/"><img src="http://top100-images.rambler.ru/top100/banner-88x31-rambler-black2.gif" alt="Rambler's Top100" width="88" height="31" border="0" /></a>
<!-- end of Top100 logo -->
<?php

Volk

Не работает. Вылетает ошибка

Adren

Удалите кавычку в слове rambler's
"Чем тише человек говорит, тем лучше его слушают"

Volk

?> остается в шаблоне после вставки если убрать кавычку

Adren

Цитата: Volk от 09 января 2009, 15:40:39
?> остается в шаблоне после вставки если убрать кавычку
мне что-то кажется, что вы что-то не так делаете, как надо, привожу пример как встевлено у меня :
фрагменты index.template

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var mainHeader = new smfToggle("upshrink", ', empty($options['collapse_header']) ? 'false' : 'true', ');
mainHeader.useCookie(', $context['user']['is_guest'] ? 1 : 0, ');
mainHeader.setOptions("collapse_header", "', $context['session_id'], '");
mainHeader.addToggleImage("upshrink", "/upshrink.gif", "/upshrink2.gif");
mainHeader.addTogglePanel("upshrinkHeader");
mainHeader.addTogglePanel("upshrinkHeader2");
// ]]></script>
<!-- begin of Top100 code -->
<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?1573636"></script><noscript><img src="http://counter.rambler.ru/top100.cnt?1573636" alt="" width="1" height="1" border="0"></noscript>
<!-- end of Top100 code -->';

echo '
</head>
<body>';
}

низ (вторая часть)

', theme_copyright(), '
</td>
<td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'left' : 'right', '">
</td>
</tr>
</table>';
echo '<table cellpadding="0" cellspacing="0" width="100%" ><tr><td align="center" class="smalltext"><a href="http://smf2.uuuq.com">RuNet theme Powered by [cer]</a><br /><!-- begin of Top100 logo -->
<a href="http://top100.rambler.ru/top100/"><img src="http://top100-images.rambler.ru/top100/banner-88x31-rambler-blue3.gif" alt="Ramblers Top100" width="88" height="31" border="0" /></a>
<!-- end of Top100 logo -->
</td></tr></table>';

Находите отличия :)
"Чем тише человек говорит, тем лучше его слушают"

Volk

У вас выставлен через echo

у меня через него выдает ошибку. А по вашему способу остается знак вопроса





// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>';
echo '
  </div>
  <center><strong><a href="http://www.cc-studio.ru/link.html" target="_blank"><font color="#FF3300">Друзья нашего сайта</a></font></strong></center>
<br>
?>
<!-- begin of Top100 code -->
<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?514982"></script><noscript><img src="http://counter.rambler.ru/top100.cnt?514982" alt="" width="1" height="1" border="0"></noscript>
<!-- end of Top100 code -->
<!-- begin of Top100 logo -->
<a href="http://top100.rambler.ru/top100/"><img src="http://top100-images.rambler.ru/top100/banner-88x31-rambler-black2.gif" alt="Ramblers Top100" width="88" height="31" border="0" /></a>
<!-- end of Top100 logo -->
<?php</body></html>';}// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..function theme_linktree(){	global $context, $settings, $options;	echo '<div id="linktree">';	// Each tree item has a URL and name. Some may have extra_before and extra_after.	foreach ($context['linktree'] as $link_num => $tree)	{		// Show something before the link?		if (isset($tree['extra_before']))			echo $tree['extra_before'];		// Show the link, including a URL if it should have one.		echo $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '">' . $tree['name'] . '</a>' : $tree['name'];		// Show something after the link...?		if (isset($tree['extra_after']))			echo $tree['extra_after'];		// Don't show a separator for the last one.		if ($link_num != count($context['linktree']) - 1)			echo ' » ';	}	echo '</div>';}// Show the menu up top. Something like [home] [help] [profile] [logout]...function template_menu(){	global $context, $settings, $options, $scripturl, $txt;	// Work out where we currently are.	$current_action = 'home';	if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))		$current_action = 'admin';	if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))		$current_action = $context['current_action'];	if ($context['current_action'] == 'search2')		$current_action = 'search';	if ($context['current_action'] == 'theme')		$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';	// Are we using right-to-left orientation?	if ($context['right_to_left'])	{		$first = 'last';		$last = 'first';	}	else	{		$first = 'first';		$last = 'last';	}	// Show the start of the tab section.	echo '		  <ul class="menu1">';  	// Show the [home] button.	echo '<li', $current_action == 'home' ? ' class="chosen"' : '', '><a href="', $scripturl, '"><b>' , $txt[103] , '</b></a></li>';	// Show the [help] button.	echo '<li', $current_action == 'help' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=help"><b>' , $txt[119] , '</b></a></li>';	// How about the [search] button?	if ($context['allow_search'])	echo '<li', $current_action == 'search' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=search"><b>' , $txt[182] , '</b></a></li>';	// Is the user allowed to administrate at all? ([admin])	if ($context['allow_admin'])	echo '<li', $current_action == 'admin' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=admin"><b>' , $txt[2] , '</b></a></li>';	// Edit Profile... [profile]	if ($context['allow_edit_profile'])	echo '<li', $current_action == 'profile' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=profile"><b>' , $txt[79] , '</b></a></li>';	// Go to PM center... [pm]	if ($context['user']['is_logged'] && $context['allow_pm'])	 echo '<li', $current_action == 'pm' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=pm"><b>' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</b></a></li>';	// The [calendar]!	if ($context['allow_calendar'])	echo '<li', $current_action == 'calendar' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=calendar"><b>' , $txt['calendar24'] , '</b></a></li>';	// the [member] list button	if ($context['allow_memberlist'])	echo '<li', $current_action == 'mlist' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=mlist"><b>' , $txt[331] , '</b></a></li>';	// If the user is a guest, show [login] button.	if ($context['user']['is_guest'])	echo '<li', $current_action == 'login' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=login"><b>' , $txt[34] , '</b></a></li>';	// If the user is a guest, also show [register] button.	if ($context['user']['is_guest'])	echo '<li', $current_action == 'register' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=register"><b>' , $txt[97] , '</b></a></li>';	// Otherwise, they might want to [logout]...	if ($context['user']['is_logged'])	echo '<li', $current_action == 'logout' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><b>' , $txt[108] , '</b></a></li>';	echo '			  </ul>';}// Generate a strip of buttons.function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = ''){	global $settings, $buttons, $context, $txt, $scripturl;	// Create the buttons...	foreach ($button_strip as $key => $value)	{		if (isset($value['test']) && empty($context[$value['test']]))		{			unset($button_strip[$key]);			continue;		}		elseif (!isset($buttons[$key]) || $force_reset)			$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';		$button_strip[$key] = $buttons[$key];	}	if (empty($button_strip))		return '<td> </td>';	echo '		<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '"> </td>		<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode('  &nbsp;  ', $button_strip) , '</td>		<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '"> </td>';}?>



Adren

Не может через echo выдавать ошибку если все правильно сделано!  :D
Попробуйте сделать так как в примере и удалить кавычки в слове ramblers
Напоминаю, что содержимое оператора echo должно выглядить так:
echo 'то, что нужно вывести';
Особое внимание прошу уделить кавычкам и точке с запятой
Видимо вы где-то напутили с кавычками, если страница выдает ошибку
Также можно тут посмотреть http://www.simplemachines.ru/index.php/topic,8.0.html
"Чем тише человек говорит, тем лучше его слушают"

Volk

Странно:( Добавлял этот код. Где я ошибся?

echo '<!-- begin of Top100 code -->
<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?514982"></script><noscript><img src="http://counter.rambler.ru/top100.cnt?514982" alt="" width="1" height="1" border="0"></noscript>
<!-- end of Top100 code -->
<!-- begin of Top100 logo -->
<a href="http://top100.rambler.ru/top100/"><img src="http://top100-images.rambler.ru/top100/banner-88x31-rambler-black2.gif" alt="Ramblers Top100" width="88" height="31" border="0" /></a>
<!-- end of Top100 logo -->';

Volk

разобрался. Там просто надо было вставить код счетчика и апостроф убрать. Спасибо за помощь