Ïîìîãèòå ÷àéíèêó, ðàçîáðàòüñÿ themes.inc... Ïîìîãèòå ÷àéíèêó, ðàçîáðàòüñÿ themes.inc...
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Ïîìîãèòå ÷àéíèêó, ðàçîáðàòüñÿ themes.inc...

Started by ULISS, January 05, 2007, 04:48:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ULISS

Ëþäè äîáðûå è íå î÷åíü ïîìîãèòå!  :-\
Õî÷ó äîáàâèòü  ôàéë â øàáëîí ãàëåðåè, íàïðèìåð:


<?
include "../qchat/mess.php";
?>


Êàê åãî ìîæíî âûâåñòè?  ??? ??? ???

Alex Revo

ß äåëàë òàê:

â iclude/themes.inc.php íàéòè:
  // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}

-ýòî çîíà âûâîäà êíîïîê ïîäìåíþ, â íóæíîì ìåñòå ñðåäè/ïîñëå êíîïîê âñòàâèòü:

addbutton($sub_menu_buttons,'{MESS_LNK}','{MESS_TITLE}','{MESS_TGT}','mess',$template_sub_menu_spacer);

Çàòåì íàéòè:
  if (!$CONFIG['custom_lnk_url']) {
        template_extract_block($template_sub_menu, 'custom_link');
    }

    $param = array(

 íóæíîì ìåñòå ñðåäè/ïîñëå ñîîòâ. îïèñàíèé êíîïîê âñòàâèòü:

        '{MESS_TGT}' => "mess.php",
        '{MESS_TITLE}' => $lang_main_menu['mess_title'],
        '{MESS_LNK}' => $lang_main_menu['mess_lnk'],
        '{MESS_TGT}' => "mess.php",
        '{MESS_TITLE}' => $lang_main_menu['mess_title'],
        '{MESS_LNK}' => $lang_main_menu['mess_lnk'],

Åñëè äîáàâëÿåøü â êîíåö ìàññèâà, ïîñëåäíþþ çàïÿòóþ íå ñòàâèøü

Îòêðûâàåøü ÿçûêîâîé ôàéë â ïàïêå lang

Íàéòè:
$lang_main_menu = array(

Äîáàâèòü â ìàññèâ çàïèñè

'mess_title' => 'Ïîäñêàçêà(íàçâàíèå) ïóíêòà ìåíþ',
'mess_lnk' => 'Èìÿ ïóíêòà ìåíþ',

Alex Revo

 ïðåäûäóùåì ïîñòå îøèáêà, äâà ðàçà âñòàâèë

'{MESS_TGT}' => "mess.php",
'{MESS_TITLE}' => $lang_main_menu['mess_title'],
'{MESS_LNK}' => $lang_main_menu['mess_lnk'],

âñòàâëÿòü êîä íóæíî îäèí ðàç...

ULISS

Ñïàñèáî ÷åëîâå÷åñêîå, çàâòðî ïîïðîáóþ, à òî âñå ìîçãè âûñîõëè îøèáêà è óñ¸ ...

Bf-Bf

À êàê áûòü, åñëè íåîáõîäèìî èìåííî âñòàâèòü ôàéë ñ êîäîì â ãàëåðåþ? Íàïðèìåð åñòü ó ìåíÿ ìåíþ, êîòîðîå âñòàâëÿåòñÿ èç îäíîãî ôàéëà âî âñå ñòðàíèöû ñàéòà ñ ïîìîùüþ <? include("ïóòü/ôàéë")?>. Åñëè ïðîñòî âïèñàòü ýòî â template.html, òî ðàáîòàòü íå áóäåò.
Õîòåëîñü áû â template.html ïðîñòî âïèñàòü ÷òî-òî òèïà {MY_SITE_MENY}, êîòîðîå áû ñîîòâåòñòâîâàëî âûøåóêàçàííîé ôóíêöèè.
Ïîäñêàæèòå êàê ýòî ïðàâèëüíî ñäåëàòü.

Alex Revo

ß íå ìîãó áûñòðî ñêàçàòü, êàê ýòî ñäåëàòü ïðàâèëüíî, íî òîëüêî ÷òî ïîïðîáûâàë òàê:

â ôàéëå themes.inc.php íàøåë:

if (!function_exists('theme_main_menu')) {  //{THEMES}
function theme_main_menu($which)
{

íèæå ïî êîäó ìàññèâ ñ êíîïêàìè:
   $param = array(
'{HOME_TGT}' => $CONFIG['home_target'],
'{HOME_TITLE}' => $lang_main_menu['home_title'],
'{HOME_LNK}' => $lang_main_menu['home_lnk'],
...

â êîíöå, ïåðåä ñòðîêîé:    );
âñòàâèë äëÿ ïðîáû:   include "my_site_menu.php",

ñîäåðæèìîå ôàéëà áûëî âûâåäåíî íà ýêðàí áåç ïðîáëåì.

Ó âàñ ìîãóò âîçíèêíóòü ñëîæíîñòè ñ ïîçèöèîíèðîâàíèåì, òóò íóæíî ïðîáûâàòü ðàçíûå âàðèàíòû, òî÷íî ñêàçàòü íå ìîãó, íå ñèëåí ïîêà  ;)


Alex Revo

Âñïîìíèë åùå êîå-÷òî, â êîíôèãå - íàñòðîéêà òåì åñòü ïîëÿ äëÿ ïîäêëþ÷åíèÿ äîïîëíèòåëüíûõ ôàéëîâ â âåðõíåé è íèæíåé ÷àñòè ãàëåðåè.
Ýòî âàì íå ïîäõîäèò?