Results 1 to 6 of 6

Thread: Please help with php forum code

  1. #1
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Please help with php forum code

    Please bear with me, I'm new to php. I've installed EasyForum (php) on a site. I need to have a logo at the top of the page.

    They offer instructions, It says to add a line of code on the config.php page but it doesn't work, no matter where I put it. What am I missing here?

    Here is the link to the code they gave me:
    http://www.triciacontala.com/README.HTM

    Here is the software main site: http://hot-things.net/cs/articles.php?cid=4

    Any help would be appreciated.

    Trish

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    Can you please show us the code where you have tried to insert the logo image.

  3. #3
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Code that won't work

    Thank you for replying


    This is the "config.php" page. It says to put it in the "Body" (there is no body) I placed it where the 1st forum begins on page:

    PHP Code:
    <?php error_reporting(1);if(function_exists('import_request_variables')){import_request_variables("gpc");$REMOTE_ADDR=$HTTP_SERVER_VARS['REMOTE_ADDR'];$PHP_SELF=$HTTP_SERVER_VARS['PHP_SELF'];$SERVER_NAME=$HTTP_SERVER_VARS['SERVER_NAME'];$SCRIPT_NAME=$HTTP_SERVER_VARS['SCRIPT_NAME'];}

    error_reporting(8);

    $time_format='d M Y H:i';                  // time format [ allowed attributes: [url]http://www.php.net/date[/url] ]
    $members_only=0;                           // guests are allowed to post (yes=0 or no=1)
    $members_edit=1;                           // all members are allowed to edit their posts (yes=1 or no=0)
    $pass_field='text';                        // password fields ('text'=visible, 'password'=*****)
    $allow_proxies=1;                          // proxy users are allowed (yes=1 or no=0) (some proxy servers cannot be detected)
    $post_interval=30;                         // interval between posts (seconds)
    $topics_max=150;                           // max number of topics per forum
    $posts_max=20;                             // max number of posts in a topic
    $topics_per_page=10;                       // topics per page

    $admin_mail="not_set_yet";                 // admin e-mail address (if you want to receive all posts via e-mail)
    include "incl/lang-en.inc";                // language file
    $members_file="-members.php";              // members file

    $flood[0]=7;                               // how many posts out of the latest 10 an IP can have (a number greater than 10 would switch this off)
    $flood[1]=15;                              // allowed length of the username
    $flood[2]=20;                              // allowed length of the subject
    $flood[3]=3000;                            // allowed length of the post
    $flood[4]=80;                              // allowed length of a word
    $flood[5]=100;                             // allowed length of the members info
    $flood[6]=60;                              // allowed lines in a post
                                               // !!! set greater values (at least current*8) for flood[1-5] if you use Chinese, Japanese etc

    $bad_words=array('****','*****');          // words which are not acceptable

    $auto_repair=1;                            // repair if necessary (yes=1 or no=0)
    $gzip=1;                                   // use gzip compression (1=yes, 0=no)
    $color_changing=1;                         // color changing (yes=1 or no=0)
    $default_css=2;                            // default CSS file (a number between 0 and 9)
    $rss_entries=5;                            // number of RSS entries

    $cellpadding=8;                            // table cellpadding
    $size_img[0]='width="15" height="15"';     // size of the smilie pictures
    $size_img[1]='width="11" height="14"';     // size of the avatar pictures
    $size_img[2]='width="19" height="24"';     // size of the topic pictures
    $size_img[3]='width="14" height="14"';     // size of the post pictures

    $forum_name=array();$forum_data=array();$forum_back=array();$forum_desc=array();
    [
    COLOR="Red"]'incl/cust-top.inc'[/COLOR]
    $forum_name[0]='1st forum';                // the name of forum #1 (the default one)
    $forum_data[0]='data';                     // a CHMODed to 777 directory
    $forum_back[0]='backup';                   // a CHMODed to 777 directory (backup directory for this forum)
    $forum_desc[0]='description...';           // a few words to describe this forum

    // $forum_name[1]='2nd forum';             // the name of forum #2
    // $forum_data[1]='';                      // a CHMODed to 777 directory
    // $forum_back[1]='';                      // a CHMODed to 777 directory (backup directory for this forum)
    // $forum_desc[1]='description...';        // a few words to describe this forum

    // $forum_name[2]='3rd Forum';             // the name of forum #3
    // $forum_data[2]='';                      // a CHMODed to 777 directory
    // $forum_back[2]='';                      // a CHMODed to 777 directory (backup directory for this forum)
    // $forum_desc[2]='description...';        // a few words to describe this forum

    // $forum_name[3]='4th Forum';             // the name of forum #4
    // $forum_data[3]='';                      // a CHMODed to 777 directory
    // $forum_back[3]='';                      // a CHMODed to 777 directory (backup directory for this forum)
    // $forum_desc[3]='description...';        // a few words to describe this forum

    if(isset($f)&&strlen($f)<3&&strlen($f)>0){$f=(int)$f;
    if(!isset(
    $forum_data[$f])||!is_dir($forum_data[$f])){$f=0;}}
    else{
    $f=0;}

    $data=$forum_data[$f];$log="$data/gshow";
    $nav1temp=0;$nav2temp=0;$nav3temp=0;$row_bg='a';
    set_magic_quotes_runtime(0);$current_time=time();

    if(
    $color_changing==1){$css_file=(int)$default_css;if(!isset($ccss)&&!isset($gcss)){setcookie('ccss',$css_file,time()+86400*100,'/');$gcss=$css_file;}elseif(isset($gcss)){$gcss=(int)$gcss;setcookie('ccss',$gcss,time()+86400*100,'/');}else{$gcss=$ccss;}}
    if(!isset(
    $user_time)){$user_time=0;}else{$user_time=(int)$user_time;}
    $show_time=gmdate('H:i',$current_time+$user_time*3600);

    function 
    time_to_run(){$time=microtime();$time=explode(" ",$time);return $time[1]+$time[0];}$start_time=time_to_run();
    function 
    disk_space(){$s=true;if(function_exists('disk_free_space')){$a=disk_free_space("/");if(is_int($a)&&$a<204800){$s=false;}}return $s;}
    function 
    redirect($n){die("<script type=\"text/javascript\">window.location='$n';</script><title>...</title></head><body></body></html>");}
    function 
    file_allowed($n){global $f,$data;$ok=0;$handle=opendir($data);while($entry=readdir($handle)){if($entry==$n&&substr($entry,0,1)=='2'){$ok=1;break;}}closedir($handle);if($ok==0){redirect("index.php");}}
    function 
    switch_row_bg(){global $row_bg;if($row_bg=='a'){$row_bg='b';}else{$row_bg='a';}}
    function 
    open_file($n){$fd=fopen($n,"r") or die('...');$fs=fread($fd,filesize($n));fclose($fd);return $fs;}
    function 
    save_file($m,$n,$o){if(disk_space()){$n=trim($n);if($n==''){$n=' ';}$n=str_replace("\n\n","\n",$n);$p=0;do{$fd=fopen($m,"w+") or die($o);$fout=fwrite($fd,$n);fclose($fd);$p++;}while(filesize($m)<5&&$p<5);}}
    function 
    clean_entry($w){$w=stripslashes($w);$w=trim($w);$w=str_replace("<","&lt;",$w);$w=str_replace(">","&gt;",$w);$w=str_replace(":|:","",$w);$w=str_replace("\r\n","[br]",$w);$w=str_replace("\r","",$w);$w=str_replace("\n","",$w);return $w;}
    function 
    set_navbar($b,$o){global $nav1temp,$nav2temp,$nav3temp,$topics_per_page;$nav1temp=$topics_per_page*$b;$nav2temp=$nav1temp-$topics_per_page+$o;$nav3temp=$nav1temp-($topics_per_page-1);}
    function 
    remove_bad_words($w){global $bad_words;for($i=0;$i<count($bad_words);$i++){$w=eregi_replace($bad_words[$i],'***',$w);}return $w;}
    function 
    time_offset($s){global $time_format,$user_time;return gmdate($time_format,$s+$user_time*3600);}

    if(!
    is_writeable($members_file)){save_file($members_file,'<?php die();?>',"<b>$members_file</b> is not writeable!<br /><small>CHMOD <b>$members_file</b> to 777 by an FTP program.</small>");}
    if(!
    is_writeable($log)){save_file($log,'',"<b>/$data</b> or a file in this directory is <b>not</b> writeable!<br /><small>CHMOD <b>/$data</b> and all files inside to 777 by an FTP program.</small>");}
    if(
    filesize($log)<9&&$auto_repair==1){include "incl/repair.inc";}

    if(
    function_exists('ob_gzhandler')&&$gzip==1){ob_start("ob_gzhandler");}

    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    ?>

    It says the code above will lead to this page cust-top.inc , so I added what I thought would work in here



    Code:
    <a href="http://www.swordofpower.org/forums/pics/forumheader.jpg">
    <table align="center" border="0" width="640"><tr><td class="s">
    <?php
    print '<a href="wap.php" style="color:#ffffff" title="Phones &amp; PDA">wap</a> ';
    if(stristr($PHP_SELF,'main.php')){
    print '<a href="rdf.php?f='.$f.'" style="color:#ffffff" title="RSS/RDF1.0 feed">rss1</a> ';
    print '<a href="rss.php?f='.$f.'" style="color:#ffffff" title="RSS2.0 feed">rss2</a> ';
    print '<a href="klip.php?f='.$f.'&amp;/forum-'.$f.'.klip" style="color:#ffffff" title="KlipFolio allows a user to subscibe to, configure and then monitor a wide variety of real-time information services on their desktop like weather, stocks, breaking news, rss feeds or auctions. These information services are called Klips. Go to http://klipfarm.com and get KlipFolio!">klip</a>';
    }
    ?>
    
    </td><td class="s" align="right">
    <?php 
    
    /* navigation bar with a drop-down menu - multiforum only! */
    
    // if(count($forum_name)>1&&count($forum_data)>1){
    // print '<form action="index.php" onsubmit="return false">';
    // print '<select onchange="if(this.value.indexOf(\'.php\')!=-1){window.location=this.value}">';
    // print '<option value="0">Choose a forum...</option>';
    // if(!stristr($PHP_SELF,'admin')){print '<option value="index.php">index -&gt;</option>';}
    // for($i=0;$i<count($forum_data);$i++){
    // if(stristr($PHP_SELF,'admin')){$page='admin.php';}else{$page='main.php';}
    // print "<option value=\"$page?f=$i\">$forum_name[$i]</option>";}
    // print '</select></form>';} 
    
    
    /* navigation bar with links - multiforum only! */
    
    if(count($forum_name)>1&&count($forum_data)>1){
    if(!stristr($PHP_SELF,'admin')){print '<a href="index.php" style="color:#ffffff">index</a><span class="w">:</span>';}
    for($i=0;$i<count($forum_data);$i++){
    if(stristr($PHP_SELF,'admin')){$page='admin.php';}else{$page='main.php';}
    print " <a href=\"$page?f=$i\" style=\"color:#ffffff\">$forum_name[$i]</a>";}
    }
    
    ?></td></tr><tr><td colspan="2">
    I'm so frustrated.

    Trish
    Last edited by Snookerman; 05-19-2009 at 04:22 PM. Reason: added [php] and [code] tags

  4. #4
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    Based on my reading of the instructions you have 2 ways of including a logo.

    The first is by editing this file 'incl/cust-top.inc', it seems to read that it is in that file that you can include things like your site headers. I am not sure if you need to change anything in the config.php file other than you might need to add this line 'include "incl/cust-top.inc";

    The other option for putting in a logo is to edit the 'lang-en.inc' file.

    Their instructions say the following - 'You can replace the title EasyForum! 2.x appearing at the top of the forum with any other title you wish or just insert an image tag: (lang-xx.inc, line #6)'.

    To me this means you edit your 'lang-en.inc', this is the one named in your config.php file, and change line 6 by replacing their title with something like <img src="mylogo.jpg">.

    Hope this helps

  5. #5
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Forum code issue

    Thank you for your response and time.

    I've changed that line in the code and it's not showing. I'm not sure where the image has to go to be read, here do I put the image?

    Forum root, inc, pic?




    Code:
    <?php 
    /* English */
    
    $lang=array();
    $lang[0]='Click here to refresh the latest topics...';
    $lang[1]='ISO-8859-1:en';               // set properly: 'charset:xx' where xx is 2-letters country code
    $lang[2]='<img src="forumheader.jpg">.';
    $lang[3]='Submit';
    $lang[4]='Cancel';
    $lang[5]='Change colors...';
    $lang[6]='ANGRY';
    $lang[7]='COOL';
    $lang[8]='SAD';
    $lang[9]='SHOUT';
    $lang[10]='SMILE';
    $lang[11]='WINK';
    $lang[12]='BOLD';
    $lang[13]='ITALIC';
    $lang[14]='COLOR';
    $lang[15]='Date / Time';
    $lang[16]='Name';
    $lang[17]='Post';
    $lang[18]='New Topic';
    $lang[19]='Add Post';
    $lang[20]='Subject';
    $lang[21]='Topics';
    $lang[22]='Edit';
    $lang[23]='Author';
    $lang[24]='Last Post';
    $lang[25]='Posts';
    $lang[26]='Views';
    $lang[27]='Refresh';
    $lang[28]='Author  / Subject';
    $lang[29]='Displaying a topic';
    $lang[30]='Top';
    $lang[31]='sec';
    $lang[32]='Search';
    $lang[33]='Action';
    $lang[34]='Delete';
    $lang[35]='WARNING! There is no UNDO after a DELETE operation.';
    $lang[36]='All fields are required...';
    $lang[37]='modified';
    $lang[38]='Preview';
    $lang[39]='No results. Try another search...';
    $lang[40]='There were more than 10 results. Please look for something more specific...';
    $lang[41]='Image';
    $lang[42]=' Stop Loading : Reload : Open ';
    $lang[43]='Image file (URL):';
    $lang[44]='Ban';
    $lang[45]='IP';
    $lang[46]='Group';
    $lang[47]='Banned users';
    $lang[48]='IP address';
    $lang[49]='Unban';
    $lang[50]='<h3>Forbidden</h3>You have been banned!';
    $lang[51]='Backup/Restore';
    $lang[52]='Backup now!';
    $lang[53]='Restore';
    $lang[54]='Sometimes you may experience a disk error which might erase the most important \\\'data\\\' file from the forum, or you might run out of space which would 
    
    have the same effect. You could try to repair the forum by using this tool. You will be asked to confirm the changes. Click OK to continue.';
    $lang[55]='Repair';
    $lang[56]='Password';
    $lang[57]='E-mail';
    $lang[58]='Info';
    $lang[59]='Please choose another name...';
    $lang[60]='New member';
    $lang[61]='Forgotten password';
    $lang[62]='Member';
    $lang[63]='Members';
    $lang[64]='Enter your member password';
    $lang[65]='Check your e-mail...';
    $lang[66]='Members only...';
    $lang[67]='Login';
    $lang[68]='Logout';
    $lang[69]='Welcome';
    $lang[70]='Good bye';
    $lang[71]='Setup an admin password and click OK!';
    $lang[72]='Your local time';
    $lang[73]='It is recommended to restore this manually. Click OK to continue.';
    $lang[74]='Visitors behind a proxy cannot use this feature.';
    $lang[75]='You will be able to post in '.$post_interval.' seconds.';
    $lang[76]='Move';
    $lang[77]='You are not so clever';
    ?>
    Thank you
    Tricia
    Last edited by Snookerman; 05-19-2009 at 05:38 PM. Reason: added [code] tags

  6. #6
    Join Date
    Jul 2008
    Posts
    138
    Thanks
    13
    Thanked 1 Time in 1 Post

    Default

    In the current file you're editing instead of...

    PHP Code:
    $lang[2]='<img src="forumheader.jpg">.'
    have you tried

    PHP Code:
    $lang[2]='<a href="http://www.swordofpower.org/forums/pics/forumheader.jpg">'
    just to see if you get your image?

    If it shows then you know it was just an issue with the path from the current file you're editing and it not seeing the image. Good luck.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •