Dynamic Title by sql

Discussion in 'PHP' started by Malatya, Mar 22, 2009.

  1. #1
    Hi all dp masters.I need a small help.I say small because i am a programmer but do not know php well.I feel someone can solve my problem who is good at php.Here is problem, the script is easy for modify but i cant find true code.I want to see forum titles on site <title>

     $topic_info = sql_row("SELECT * FROM frm_forum_topics WHERE topic_id = '".$_GET['topic']."'");
     $board_info = sql_row("SELECT board_name FROM frm_forum_boards WHERE board_id = '".$_GET['board']."'");
    
    PHP:
    
     if ($FRMSITEURL == SITEURL.'/forums/view.topic.php') { define('SITETITLE', $_GET['topic'].' a', true); }
     if ($FRMSITEURL == SITEURL.'/forums/view.board.php') { define('SITETITLE', 'Example of static title, true); }
    
    PHP:
    When i make this i write a dynamic title, forums id, but i dont want id i want title.So i investigate the code.

    
      <td class="forum_text"><?php echo '<a href="index.php" class="text_2_css">'.$lang['forums_index'].'</a> &raquo;
                  <a href="view.board.php?board='.$_GET['board'].'" class="text_2_css">'.$board_info['board_name'].'</a> &raquo;
                  <a href="view.topic.php?board='.$_GET['board'].'&topic='.$_GET['topic'].'" class="text_2_css">
                  '.wrap_text($topic_info['topic_title'], '100').'</a>';?></td>
    
    PHP:
    This code writes title and board name.It works. I need to write title (topic_title) and board (board_name) but i cant.

    Then i make me a variable.

    $topic_tit = sql_row("SELECT * FROM joovili_forum_topics WHERE topic_title = '".$_GET['tit']."'");  
    PHP:
    then
    
     if ($FRMSITEURL == SITEURL.'/forums/view.topic.php') { define('SITETITLE', $_GET['tit'].' a', true); }
    PHP:
    Maybe a make it wrong because id is a number topic is char but i dont know true combination.Also i have to change order but when i try i get (T_CONSTANT_ENCAPSED_STRING) error.Here is the order
    define('SITETITLE', $_GET['topic'].' a', true); }
    PHP:
    Site / topic (i hope a friend help me and i can make this) /a (a is a char, i cant remove it, when try get error)

    I want to change the order Topic/ site (remove a)

    I know it is long but hope it is easy.
     
    Malatya, Mar 22, 2009 IP