add menu items in "left menu"

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
guarez
Posts: 11
Joined: Thu Jul 27, 2006 4:26 am

add menu items in "left menu"

Post by guarez »

hi.. how i can add more menu items to some webpages? like http://www.phpmyfaq.de << top left menu?

and how i can use the same temnplate like your site? in the new pages added in the menu?
david_de
Posts: 72
Joined: Tue Dec 13, 2005 12:09 am

Post by david_de »

Go to that page and select "View-Page Source" and you will see what to add for more links.
guarez
Posts: 11
Joined: Thu Jul 27, 2006 4:26 am

Post by guarez »

thankz! :D

now.. how i can get the same look in the new pages?

like this site ( www.phpmyfaq.de ) the new pages have the left menu and the same header and footer..

i need to edit some template? or just make a php file with some extra code?
guarez
Posts: 11
Joined: Thu Jul 27, 2006 4:26 am

Post by guarez »

hi.. again

i cant add a simple page in the left menu =(

i edit the index.tpl and add my menu

<!-- start categories -->
<div class="content">
<div id="categories">
<ul>
<li class="home">{backToHome}</li>
<li><a href="mynewpage.php">My New Page</a></li> <li>{allCategories}</li>
{showCategories}
<li>{showSitemap}</li>

</ul>
</div>
</div>
<!-- end categories -->

i made a copy of index.tpl and rename it to mynewpage.tpl , i thnik i need to change only the "main" section in the template?

<!-- start main content -->
<div class="centercolumn">
<div class="centerpadding">
<div class="main-content" id="main">


HERE I WRITE WHAT I WANT?!!


{writeContent}
</div>

</div>
</div>
<!-- end main content -->


sorry but i dont understand how :roll:

my php file have a simple text "hello world!!" but i odnt see the menus, headers and footer pages :roll:
Last edited by guarez on Sat Aug 12, 2006 3:45 am, edited 1 time in total.
guarez
Posts: 11
Joined: Thu Jul 27, 2006 4:26 am

Post by guarez »

any1?
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

if you want to add the whole layout of phpMyFAQ in your own file. your way to do this was wrong. I described it here: viewtopic.php?t=2590

I'll plan a better description of that the next weeks.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
guarez
Posts: 11
Joined: Thu Jul 27, 2006 4:26 am

Post by guarez »

mm i made all the changes and now i have a white page =) with a

{writeContent} en the main column

when i write some php code, the output texto go to the top of page, above headers :roll:

and if i write something in the tpl file the text show OK in the main column.

How i can put the php ouput inthe main column?
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you post your changes here?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
guarez
Posts: 11
Joined: Thu Jul 27, 2006 4:26 am

Post by guarez »

Look the files



my new file IP.tpl

Code: Select all

<h2>Hi!</h2>

Mi first page
my new file IP.php

Code: Select all

<?php 
   echo "First PHP code<br>"; 
    
   for($i=0;$i<10;$i++) 
   { 
      echo "Line ".$i."<br>"; 
   } 
?> 
File index.tpl

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{metaLanguage}" lang="{metaLanguage}">
<head>
    <title>{title}</title>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset={metaCharset}" />
<META name="verify-v1" content="Eb7pGvXLA0PCf1v0cfHyRNiTSIGb0NUMF6rgwa+cdG0=" />
    <meta name="title" content="{title}" />
    <meta name="description" content="{metaDescription}" />
    <meta name="keywords" content="{metaKeywords}" />
    <meta name="author" content="{metaPublisher}" />
    <meta name="publisher" content="{metaPublisher}" />
    <meta name="copyright" content="(c) 2001 - 2006 phpMyFAQ Team" />
    <meta name="Content-Language" content="{metaCharset}" />
    <meta name="robots" content="INDEX, FOLLOW" />
    <meta name="revisit-after" content="1 days" />
    <meta name="MSSmartTagsPreventParsing" content="true" />
    <style type="text/css" media="screen">
    /*<![CDATA[*/
    <!--
    @import url(template/style.css);
    @import url(template/colors.css);
    -->
    /*]]>*/
    </style>
    <style type="text/css" media="print">
    /*<![CDATA[*/
    <!--
    @import "template/print.css";
    -->
    /*]]>*/
    </style>
    <script type="text/javascript"  src="inc/functions.js"></script>
    <link rel="shortcut icon" href="template/favicon.ico" type="image/x-icon" />
    <link rel="icon" href="template/favicon.ico" type="image/x-icon" />
    <link rel="alternate" title="News RSS Feed" type="application/rss+xml" href="feed/news/rss.php" />
    <link rel="alternate" title="TopTen RSS Feed" type="application/rss+xml" href="feed/topten/rss.php" />
    <link rel="alternate" title="Latest FAQ Records RSS Feed" type="application/rss+xml" href="feed/latest/rss.php" />
    <link rel="alternate" title="Open Questions RSS Feed" type="application/rss+xml" href="feed/openquestions/rss.php" />
</head>
<body dir="{dir}">

<div id="wrapper1">
    <div id="wrapper2">
     <!-- start headers -->
     
    
     
    <div class="header" id="header">
  
    
      <!-- <h1><a title="{header}" href="{faqHome}">{header}</a></h1> -->
          <ul>
        
            <li>{msgContact}</li>
            <li>{msgHelp}</li>
[color=red]            <!-- <li>{msgOpenQuestions}</li> -->[/color]            <li>{msgQuestion}</li>
[color=red]            <!-- <li>{msgAddContent}</li> -->[/color]            <li>{msgSearch}</li>
        </ul> 
    </div>
    <!-- end headers -->

    <!-- start columns -->
    <div class="columns">

        <!-- start left sidebar -->
        <div class="leftcolumn sidebar" id="sidebar-left">
            <div class="leftpadding">

                <h2 class="invisible">Navigation</h2>

                <!-- start categories -->
                <div class="content">
                    <div id="categories">
                    <ul>
                        <li class="home">{backToHome}</li>
[color=red]                        <li><a href="index.php?action=ip">IP address</a></li>[/color]                        <li>{allCategories}</li>
                        {showCategories}
                        <li>{showSitemap}</li>
                       
                    </ul>
                    </div>
                </div>
                <!-- end categories -->

                <!-- start search box -->
                <div class="content">
                    <div id="search">
                    <form action="{writeSendAdress}" method="get">
                    <label for="suchbegriff">{searchBox}</label>
                    <input alt="search..." class="inputfield" type="text" name="search" id="suchbegriff" size="18" /><br />
                    <input type="submit" name="submit" value="Go" class="submit" />
                    <input type="hidden" name="action" value="search" />
                    </form>
                    </div>
                </div>
                <!-- end search box -->

[color=red]                <!-- start language selection box
                <div class="content">
                    <div id="langform">
                    <form action="{writeLangAdress}" method="post">
                    <label for="language">{languageBox}</label>
                    {switchLanguages}<br />
                    <input type="submit" name="submit" value="Go" class="submit" />
                    </form>
                    </div>
                </div>
                 end -->[/color]
                <div class="content">
                    <div id="useronline">
                    {userOnline}
                    </div>
     
                
                </div>
                
               
            </div>
        </div>
        <!-- end left sidebar -->

        <!-- start right sidebar -->
        <div class="rightcolumn sidebar" id="sidebar-right">
        
            <div class="rightpadding">

                <div class="content">
                    <div id="topten">
                    <h3>{writeTopTenHeader} <a href="feed/topten/rss.php" target="_blank"><img src="images/rss.png" width="28" height="16" alt="RSS" /></a></h3>
                    {writeTopTenRow}
                    </div>
                </div>

                <div class="content">
                    <div id="latest">
                    <h3>{writeNewestHeader}&nbsp;<a href="feed/latest/rss.php" target="_blank"><img src="images/rss.png" width="28" height="16" alt="RSS" /></a></h3>
                    {writeNewestRow}
                       
                    </div>

                </div>

            </div>
            
        </div>
        
        
        
        <!-- end right sidebar -->

        <!-- start main content -->
        <div class="centercolumn">
            <div class="centerpadding">
                <div class="main-content" id="main">
                
                
                {writeContent}
                </div>
                
            </div>
        </div>
        <!-- end main content -->

    </div>

    <!-- end columns -->

    <div class="clearing"></div>

    <!-- start footer -->
    <div id="footer" class="footer">

      <!-- please do not remove the following line -->
        <p id="copyrightnote">{copyright}</p>
    </div>
    <!-- end footer -->

    <!-- start debug messages -->
    {debugMessages}
    <!-- end debug messages -->

    </div>
</div>

</body>
</html>
File constants.php

Code: Select all

<?php
/**
* $Id: constants.php,v 1.2.2.7.2.10 2006/06/17 07:30:12 matteo Exp $
*
* Constants for phpMyFAQ
*
* @author       Thorsten Rinne <thorsten@phpmyfaq.de>
* @since        2003-12-10
* @copyright    (c) 2003-2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*/

/**
 * Use this constant if you want to change your timezone
 *
 * @var integer
 */
define('PMF_DATETIME_TIMEZONE', '0'); // default: "0", example: "-0400" for 4 hours before

/**
 * Timeout for the admin section, in minutes
 *
 * @var integer
 */
define('PMF_AUTH_TIMEOUT', 30);

/**
 * Timeout for the warning about session timeout for the admin section, in minutes
 *
 * @var integer
 */
define('PMF_AUTH_TIMEOUT_WARNING', 5);

/**
 * Start value for the solution IDs
 *
 * @var const
 */
define('PMF_SOLUTION_ID_START_VALUE', 1000);

/**
 * Incremental value for the solution IDs
 *
 * @var const
 */
define('PMF_SOLUTION_ID_INCREMENT_VALUE', 1);

/**
 * Number of records for the Top 10
 *
 * @var const   10
 */
define('PMF_NUMBER_RECORDS_TOPTEN', 10);

/**
 * Number of records for the latest entries
 *
 * @var const   5
 */
define('PMF_NUMBER_RECORDS_LATEST', 5);


/**
 * This is the max number of open questions returned by the feed
 *
 * @var const   50
 */
define("PMF_RSS_OPENQUESTIONS_MAX", 50);

/****************************************************************************
 *                  DO NOT CHANGE ANYTHING BELOW THIS LINE!                 *
 ****************************************************************************/

/**
* Supported databases for phpMyFAQ
*
* @var  array
*/
$supported_databases = array(
    'mysql'     => array('4.1.0', 'MySQL 3.23 / 4.0 / 4.1 / 5.0'),
    'pgsql'     => array('4.2.0', 'PostgreSQL 7.x / 8.x'),
    'sybase'    => array('4.1.0', 'Sybase'),
    'mssql'     => array('4.1.0', 'MS SQL Server 2000 / 2005'),
    'mysqli'    => array('5.0.0', 'MySQL 4.1 / 5.0 / 5.1'),
    'sqlite'    => array('5.0.0', 'SQLite'),
    'ibm_db2'   => array('4.1.0', 'IBM DB2 Universal Database 8.2 / 9.0'),
    'maxdb'     => array('4.1.0', 'MaxDB 7.5 / 7.6 (experimental)')
    );

/* This array sets the rights for an user - DO NOT CHANGE! */
$faqrights = array (
        1 =>  'adduser',
        2 =>  'edituser',
        3 =>  'deluser',
        4 =>  'addbt',
        5 =>  'editbt',
        6 =>  'delbt',
        7 =>  'viewlog',
        8 =>  'adminlog',
        9 =>  'delcomment',
        10 => 'addnews',
        11 => 'editnews',
        12 => 'delnews',
        13 => 'addcateg',
        14 => 'editcateg',
        15 => 'delcateg',
        16 => 'passwd',
        17 => 'editconfig',
        18 => 'addatt',
        19 => 'delatt',
        20 => 'backup',
        21 => 'restore',
        22 => 'delquestion',
        23 => 'changebtrevs'
        );

/* allowed 'action' varibales for GET - DO NOT CHANGE! */
$allowedVariables = array(
        'add' => 1,
        'contact' => 1,
        'mailsend2friend' => 1,
        'save' => 1,
        'savevoting' => 1,
        'sendmail' => 1,
        'writecomment' => 1,
        'artikel' => 1,
        'help' => 1,
        'savecomment' => 1,
        'search' => 1,
        'show' => 1,
        'xml' => 1,
        'ask' => 1,
        'open' => 1,
        'savequestion' => 1,
        'ip' => 1,
        'send2friend' => 1,
        'sitemap' => 1
        );

/* ISO 639 language code list - DO NOT CHANGE! */
$languageCodes = array (
        'AF' => 'Afghanistan',
        'AA' => 'Afar',
        'AB' => 'Abkhazian',
        'AF' => 'Afrikaans',
        'AM' => 'Amharic',
        'AR' => 'Arabic',
        'AS' => 'Assamese',
        'AY' => 'Aymara',
        'AZ' => 'Azerbaijani',
        'BA' => 'Bashkir',
        'BE' => 'Byelorussian',
        'BG' => 'Bulgarian',
        'BH' => 'Bihari',
        'BI' => 'Bislama',
        'BN' => 'Bengali',
        'BO' => 'Tibetan',
        'BR' => 'Breton',
        'CA' => 'Catalan',
        'CO' => 'Corsican',
        'CS' => 'Czech',
        'CY' => 'Welsh',
        'DA' => 'Danish',
        'DE' => 'German',
        'DZ' => 'Bhutani',
        'EL' => 'Greek',
        'EN' => 'English',
        'EO' => 'Esperanto',
        'ES' => 'Spanish',
        'ET' => 'Estonian',
        'EU' => 'Basque',
        'FA' => 'Persian',
        'FI' => 'Finnish',
        'FJ' => 'Fiji',
        'FO' => 'Faeroese',
        'FR' => 'French',
        'FY' => 'Frisian',
        'GA' => 'Irish',
        'GD' => 'Gaelic',
        'GL' => 'Galician',
        'GN' => 'Guarani',
        'GU' => 'Gujarati',
        'HA' => 'Hausa',
        'HE' => 'Hebrew',
        'HI' => 'Hindi',
        'HR' => 'Croatian',
        'HU' => 'Hungarian',
        'HY' => 'Armenian',
        'IA' => 'Interlingua',
        'IE' => 'Interlingue',
        'IK' => 'Inupiak',
        'ID' => 'Indonesian',
        'IS' => 'Icelandic',
        'IT' => 'Italian',
        'IW' => 'Hebrew',
        'JA' => 'Japanese',
        'JI' => 'Yiddish',
        'JW' => 'Javanese',
        'KA' => 'Georgian',
        'KK' => 'Kazakh',
        'KL' => 'Greenlandic',
        'KM' => 'Cambodian',
        'KN' => 'Kannada',
        'KO' => 'Korean',
        'KS' => 'Kashmiri',
        'KU' => 'Kurdish',
        'KY' => 'Kirghiz',
        'LA' => 'Latin',
        'LN' => 'Lingala',
        'LO' => 'Laothian',
        'LT' => 'Lithuanian',
        'LV' => 'Latvian',
        'MG' => 'Malagasy',
        'MI' => 'Maori',
        'MK' => 'Macedonian',
        'ML' => 'Malayalam',
        'MN' => 'Mongolian',
        'MO' => 'Moldavian',
        'MR' => 'Marathi',
        'MS' => 'Malay',
        'MT' => 'Maltese',
        'MY' => 'Burmese',
        'NA' => 'Nauru',
        'NE' => 'Nepali',
        'NL' => 'Dutch',
        'NB' => 'Norwegian Bokmål',
        'NN' => 'Norwegian Nynorsk',
        'OC' => 'Occitan',
        'OM' => 'Oromo',
        'OR' => 'Oriya',
        'PA' => 'Punjabi',
        'PL' => 'Polish',
        'PS' => 'Pashto',
        'PT' => 'Portuguese',
        'PT-BR' => 'Brazilian Portuguese',
        'QU' => 'Quechua',
        'RN' => 'Kirundi',
        'RO' => 'Romanian',
        'RU' => 'Russian',
        'RW' => 'Kinyarwanda',
        'SA' => 'Sanskrit',
        'SD' => 'Sindhi',
        'SG' => 'Sangro',
        'SH' => 'Serbo-Croatian',
        'SI' => 'Singhalese',
        'SK' => 'Slovak',
        'SL' => 'Slovenian',
        'SM' => 'Samoan',
        'SN' => 'Shona',
        'SO' => 'Somali',
        'SQ' => 'Albanian',
        'SR' => 'Serbian',
        'SS' => 'Siswati',
        'ST' => 'Sesotho',
        'SU' => 'Sudanese',
        'SV' => 'Swedish',
        'SW' => 'Swahili',
        'TA' => 'Tamil',
        'TE' => 'Tegulu',
        'TG' => 'Tajik',
        'TH' => 'Thai',
        'TI' => 'Tigrinya',
        'TK' => 'Turkmen',
        'TL' => 'Tagalog',
        'TN' => 'Setswana',
        'TO' => 'Tonga',
        'TR' => 'Turkish',
        'TS' => 'Tsonga',
        'TT' => 'Tatar',
        'TW' => 'Chinese (Traditional)',
        'UK' => 'Ukrainian',
        'UR' => 'Urdu',
        'UZ' => 'Uzbek',
        'VI' => 'Vietnamese',
        'VO' => 'Volapuk',
        'WO' => 'Wolof',
        'XH' => 'Xhosa',
        'YO' => 'Yoruba',
        'ZH' => 'Chinese (Simplified)',
        'ZU' => 'Zulu'
        );
?>
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
you've written the files in a wrong way: the new files should be like the ones below.
IP.tpl:

Code: Select all

    <!-- Start Test Content -->
    <h2>{testTitle}</h2>
    <span>{testContent}</span
    <!-- End Test Content -->
and IP.php:

Code: Select all

<?php
$testTitle = 'My first PMF page';
$testContent = '';

for($i=0; $i<10; $i++) {
    $testContent .= 'Line '.$i.'<br />';
}

$tpl->processTemplate ('writeContent', array(
                            'testTitle'     => $testTitle,
                            'testContent'   => $testContent
                            )
                        );
$tpl->includeTemplate('writeContent', 'index');
?>
Regards,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Post Reply