cant get database info to show up

  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

ok i am using phpbb3 and i have phpbb3 portal (phpbb3portal.com) mod installed.. and i searched the extra pages mod. so i have the page set up and i want to import the php file that displays the data from that table.

when i go direct to the file it shows up.
when i have it in the extra page in phpbb3 it will not import it..

here is the pages i have..
Quote:
npcja.php

Code: [ Select ]
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('NPC JA');

$template->set_filenames(array(
    'body' => 'npcja.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();

?>
  1. <?php
  2. define('IN_PHPBB', true);
  3. $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
  4. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  5. include($phpbb_root_path . 'common.' . $phpEx);
  6. // Start session management
  7. $user->session_begin();
  8. $auth->acl($user->data);
  9. $user->setup();
  10. page_header('NPC JA');
  11. $template->set_filenames(array(
  12.     'body' => 'npcja.html',
  13. ));
  14. make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
  15. page_footer();
  16. ?>

Quote:
npcja.html

Code: [ Select ]
<!-- DEFINE $S_IN_PORTAL = 1 -->
<!-- INCLUDE overall_header.html -->

<!-- $Id: portal_body.html,v 1.1 2008/02/09 08:18:16 angelside Exp $ //-->
<style type="text/css">
<!--
.topiclist dd.posts_portal {
    float:left;
    text-align:left;
    font-size: 1.1em;
    padding:6px 5px 6px 5px;
}

ul.topiclist dt {
    float:left;
    width: 90%;
    font-size: 1em;
}

.gensmall {
    margin: 1px 1px;
    font-size: 10px;
}

small, .small {
    font-size:10px;
    font-weight:bold;
    font-family:Arial, Helvetica, sans-serif;
}

/* Container for sub-navigation list */
#navigation {
    padding-top: 0px;
    font-size: 1.1em;
}

/* Link styles for the sub-section links */
#navigation a {
    color: #105289;
    font-weight: normal;
    padding: 2px;
    background: #ecf1f3 none repeat-y 100% 0;
}

#navigation a:hover {
    background-color: #F9F9F9;
    color: #d31141;
}

/* News listing */
ul.news {
    border-top: 1px solid #FFFFFF;
    list-style: none;
    margin-left: 0;
}
ul.news li {
    padding: 5px 0 4px 0;
    border-bottom: 1px solid #CCCCCC;
}
ul.news li.last {
    border-bottom: none;
}
ul.news {
    border-top: none;
}
ul.news li {
    padding: 0 0 4px 0;
    margin-bottom: 5px;
    margin-left: 0;
    border-bottom-color: #E0E0E0;
}

.postbody_portal {
    width: 100%;
}
//-->
</style>

<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<!-- [+] left block area -->
    <td width="190" valign="top" style="padding-right:6px;">
    
        <!-- INCLUDE portal/block/main_menu.html -->
        
        <!-- IF S_DISPLAY_SEARCH -->
            <!-- INCLUDE portal/block/search.html -->
        <!-- ENDIF -->

        <!-- IF S_ADS_SMALL -->
            <!-- INCLUDE portal/block/ads_small.html -->
        <!-- ENDIF -->
    
        <!-- IF S_DISPLAY_CHANGE_STYLE -->
            <!-- INCLUDE portal/block/change_style.html -->
        <!-- ENDIF -->
        
        <!-- IF S_DISPLAY_PAY_S -->
            <!-- INCLUDE portal/block/donation/donation_small.html -->
        <!-- ENDIF -->

        <!-- IF S_DISPLAY_LATEST_MEMBERS -->
            <!-- INCLUDE portal/block/latest_members.html -->
        <!-- ENDIF -->

        <!-- IF S_DISPLAY_TOP_POSTERS -->
            <!-- INCLUDE portal/block/top_poster.html -->
        <!-- ENDIF -->
        
        <!-- IF S_DISPLAY_RANDOM_MEMBER -->
            <!-- INCLUDE portal/block/random_member.html -->
        <!-- ENDIF -->

        <!-- IF S_DISPLAY_CLOCK -->
            <!-- INCLUDE portal/block/clock.html -->
        <!-- ENDIF -->

        <!-- IF S_DISPLAY_MINICAL -->     
            <!-- INCLUDE portal/block/mini_calendar.html -->
        <!-- ENDIF -->    

        <!-- IF S_DISPLAY_LINK_US -->
            <!-- INCLUDE portal/block/link_us.html -->
        <!-- ENDIF -->    

        <!-- IF S_DISPLAY_LINKS -->
            <!-- INCLUDE portal/block/links.html -->
        <!-- ENDIF -->    

        <!-- IF S_DISPLAY_LAST_BOTS and S_LAST_VISITED_BOTS -->
            <!-- INCLUDE portal/block/latest_bots.html -->
        <!-- ENDIF -->

        <!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
            <!-- INCLUDE portal/block/birthday_list.html -->
        <!-- ENDIF -->

        <!-- IF not S_USER_LOGGED_IN -->
        <!-- INCLUDE portal/block/login_box.html -->
        <!-- ENDIF -->

        <!-- IF S_DISPLAY_ADVANCED_STAT -->
        <!-- INCLUDE portal/block/statistics.html -->
        <!-- ENDIF -->

        <!-- IF S_DISPLAY_ONLINE_LIST -->
        <!-- INCLUDE portal/block/whois_online.html -->
        <!-- ENDIF -->

        <!-- IF S_DISPLAY_LEADERS -->
        <!-- INCLUDE portal/block/leaders.html -->
        <!-- ENDIF -->    
        
        <!-- INCLUDE portal/block/ads_long.html -->
        
        <!--INCLUDE portal/block/_sample_block_design.html-->

    </td>
<!-- [-] left block area -->
    <td width="4" valign="top"></td>

<!-- [+] center block area -->
    <td valign="top">
    
    
        <!-- INCLUDE portal/block/ads_center.html -->


<h3>NPC Jangan</h3>

<div class="post bg2">
    <div class="inner"><span class="corners-top"><span></span></span>
    <div class="postbody postbody_portal">


<?php
include("srodatabase/npcjadb.php");
?>



    </div>
    <div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
    <span class="corners-bottom"><span></span></span></div>
</div>

<hr class="divider" />



            <!-- INCLUDE portal/block/ads_center.html -->

    

    </td>
<!-- [-] center block area -->
    <td width="4" valign="top"></td>
</tr>
</table>
<!--// phpBB3 Portal by Sevdin Filiz, http://www.phpbb3portal.com //-->
<!-- INCLUDE overall_footer.html -->
  1. <!-- DEFINE $S_IN_PORTAL = 1 -->
  2. <!-- INCLUDE overall_header.html -->
  3. <!-- $Id: portal_body.html,v 1.1 2008/02/09 08:18:16 angelside Exp $ //-->
  4. <style type="text/css">
  5. <!--
  6. .topiclist dd.posts_portal {
  7.     float:left;
  8.     text-align:left;
  9.     font-size: 1.1em;
  10.     padding:6px 5px 6px 5px;
  11. }
  12. ul.topiclist dt {
  13.     float:left;
  14.     width: 90%;
  15.     font-size: 1em;
  16. }
  17. .gensmall {
  18.     margin: 1px 1px;
  19.     font-size: 10px;
  20. }
  21. small, .small {
  22.     font-size:10px;
  23.     font-weight:bold;
  24.     font-family:Arial, Helvetica, sans-serif;
  25. }
  26. /* Container for sub-navigation list */
  27. #navigation {
  28.     padding-top: 0px;
  29.     font-size: 1.1em;
  30. }
  31. /* Link styles for the sub-section links */
  32. #navigation a {
  33.     color: #105289;
  34.     font-weight: normal;
  35.     padding: 2px;
  36.     background: #ecf1f3 none repeat-y 100% 0;
  37. }
  38. #navigation a:hover {
  39.     background-color: #F9F9F9;
  40.     color: #d31141;
  41. }
  42. /* News listing */
  43. ul.news {
  44.     border-top: 1px solid #FFFFFF;
  45.     list-style: none;
  46.     margin-left: 0;
  47. }
  48. ul.news li {
  49.     padding: 5px 0 4px 0;
  50.     border-bottom: 1px solid #CCCCCC;
  51. }
  52. ul.news li.last {
  53.     border-bottom: none;
  54. }
  55. ul.news {
  56.     border-top: none;
  57. }
  58. ul.news li {
  59.     padding: 0 0 4px 0;
  60.     margin-bottom: 5px;
  61.     margin-left: 0;
  62.     border-bottom-color: #E0E0E0;
  63. }
  64. .postbody_portal {
  65.     width: 100%;
  66. }
  67. //-->
  68. </style>
  69. <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
  70. <tr>
  71. <!-- [+] left block area -->
  72.     <td width="190" valign="top" style="padding-right:6px;">
  73.     
  74.         <!-- INCLUDE portal/block/main_menu.html -->
  75.         
  76.         <!-- IF S_DISPLAY_SEARCH -->
  77.             <!-- INCLUDE portal/block/search.html -->
  78.         <!-- ENDIF -->
  79.         <!-- IF S_ADS_SMALL -->
  80.             <!-- INCLUDE portal/block/ads_small.html -->
  81.         <!-- ENDIF -->
  82.     
  83.         <!-- IF S_DISPLAY_CHANGE_STYLE -->
  84.             <!-- INCLUDE portal/block/change_style.html -->
  85.         <!-- ENDIF -->
  86.         
  87.         <!-- IF S_DISPLAY_PAY_S -->
  88.             <!-- INCLUDE portal/block/donation/donation_small.html -->
  89.         <!-- ENDIF -->
  90.         <!-- IF S_DISPLAY_LATEST_MEMBERS -->
  91.             <!-- INCLUDE portal/block/latest_members.html -->
  92.         <!-- ENDIF -->
  93.         <!-- IF S_DISPLAY_TOP_POSTERS -->
  94.             <!-- INCLUDE portal/block/top_poster.html -->
  95.         <!-- ENDIF -->
  96.         
  97.         <!-- IF S_DISPLAY_RANDOM_MEMBER -->
  98.             <!-- INCLUDE portal/block/random_member.html -->
  99.         <!-- ENDIF -->
  100.         <!-- IF S_DISPLAY_CLOCK -->
  101.             <!-- INCLUDE portal/block/clock.html -->
  102.         <!-- ENDIF -->
  103.         <!-- IF S_DISPLAY_MINICAL -->     
  104.             <!-- INCLUDE portal/block/mini_calendar.html -->
  105.         <!-- ENDIF -->    
  106.         <!-- IF S_DISPLAY_LINK_US -->
  107.             <!-- INCLUDE portal/block/link_us.html -->
  108.         <!-- ENDIF -->    
  109.         <!-- IF S_DISPLAY_LINKS -->
  110.             <!-- INCLUDE portal/block/links.html -->
  111.         <!-- ENDIF -->    
  112.         <!-- IF S_DISPLAY_LAST_BOTS and S_LAST_VISITED_BOTS -->
  113.             <!-- INCLUDE portal/block/latest_bots.html -->
  114.         <!-- ENDIF -->
  115.         <!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
  116.             <!-- INCLUDE portal/block/birthday_list.html -->
  117.         <!-- ENDIF -->
  118.         <!-- IF not S_USER_LOGGED_IN -->
  119.         <!-- INCLUDE portal/block/login_box.html -->
  120.         <!-- ENDIF -->
  121.         <!-- IF S_DISPLAY_ADVANCED_STAT -->
  122.         <!-- INCLUDE portal/block/statistics.html -->
  123.         <!-- ENDIF -->
  124.         <!-- IF S_DISPLAY_ONLINE_LIST -->
  125.         <!-- INCLUDE portal/block/whois_online.html -->
  126.         <!-- ENDIF -->
  127.         <!-- IF S_DISPLAY_LEADERS -->
  128.         <!-- INCLUDE portal/block/leaders.html -->
  129.         <!-- ENDIF -->    
  130.         
  131.         <!-- INCLUDE portal/block/ads_long.html -->
  132.         
  133.         <!--INCLUDE portal/block/_sample_block_design.html-->
  134.     </td>
  135. <!-- [-] left block area -->
  136.     <td width="4" valign="top"></td>
  137. <!-- [+] center block area -->
  138.     <td valign="top">
  139.     
  140.     
  141.         <!-- INCLUDE portal/block/ads_center.html -->
  142. <h3>NPC Jangan</h3>
  143. <div class="post bg2">
  144.     <div class="inner"><span class="corners-top"><span></span></span>
  145.     <div class="postbody postbody_portal">
  146. <?php
  147. include("srodatabase/npcjadb.php");
  148. ?>
  149.     </div>
  150.     <div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
  151.     <span class="corners-bottom"><span></span></span></div>
  152. </div>
  153. <hr class="divider" />
  154.             <!-- INCLUDE portal/block/ads_center.html -->
  155.     
  156.     </td>
  157. <!-- [-] center block area -->
  158.     <td width="4" valign="top"></td>
  159. </tr>
  160. </table>
  161. <!--// phpBB3 Portal by Sevdin Filiz, http://www.phpbb3portal.com //-->
  162. <!-- INCLUDE overall_footer.html -->



Quote:
npcjadb.php

Code: [ Select ]
<?php
$con = mysql_connect("changed","changed","changed");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("srodatabase", $con);

$result = mysql_query("SELECT * FROM npcja");

echo "<table>
<tr>
<th>npc_name</th>
<th>npc_location</th>
<th>npc_description</th>
<th>npc_quests</th>
</tr>";

while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['npc_name'] . "</td>";
echo "<td>" . $row['npc_location'] . "</td>";
echo "<td>" . $row['npc_description'] . "</td>";
echo "<td>" . $row['npc_quests'] . "</td>";
echo "</tr>";
}
echo "</table>";

mysql_close($con);
?>
  1. <?php
  2. $con = mysql_connect("changed","changed","changed");
  3. if (!$con)
  4. {
  5. die('Could not connect: ' . mysql_error());
  6. }
  7. mysql_select_db("srodatabase", $con);
  8. $result = mysql_query("SELECT * FROM npcja");
  9. echo "<table>
  10. <tr>
  11. <th>npc_name</th>
  12. <th>npc_location</th>
  13. <th>npc_description</th>
  14. <th>npc_quests</th>
  15. </tr>";
  16. while($row = mysql_fetch_array($result))
  17. {
  18. echo "<tr>";
  19. echo "<td>" . $row['npc_name'] . "</td>";
  20. echo "<td>" . $row['npc_location'] . "</td>";
  21. echo "<td>" . $row['npc_description'] . "</td>";
  22. echo "<td>" . $row['npc_quests'] . "</td>";
  23. echo "</tr>";
  24. }
  25. echo "</table>";
  26. mysql_close($con);
  27. ?>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

Instead of the inclusion in the HTML file you can put {NPCJADB} and in the npcja.php file you could have the following:

Code: [ Select ]
<?php
include(npcjadb.php);
$template->assign_vars(array(
    'NPCJADB' => $variable
));
?>
  1. <?php
  2. include(npcjadb.php);
  3. $template->assign_vars(array(
  4.     'NPCJADB' => $variable
  5. ));
  6. ?>

And in the npcjadb.php, instead of all of those 'echo' you would have '$variable .= '. Below is what I am talking about.
Code: [ Select ]
<?php
$con = mysql_connect("changed","changed","changed");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
mysql_select_db("srodatabase", $con);
 
$result = mysql_query("SELECT * FROM npcja");
 
$variable = "<table>
<tr>
<th>npc_name</th>
<th>npc_location</th>
<th>npc_description</th>
<th>npc_quests</th>
</tr>";
 
while($row = mysql_fetch_array($result))
  {
  $variable .= "<tr>";
  $variable .= "<td>" . $row['npc_name'] . "</td>";
  $variable .= "<td>" . $row['npc_location'] . "</td>";
  $variable .= "<td>" . $row['npc_description'] . "</td>";
  $variable .= "<td>" . $row['npc_quests'] . "</td>";
  $variable .= "</tr>";
  }
$variable .= "</table>";
 
mysql_close($con);
?>
  1. <?php
  2. $con = mysql_connect("changed","changed","changed");
  3. if (!$con)
  4.   {
  5.   die('Could not connect: ' . mysql_error());
  6.   }
  7.  
  8. mysql_select_db("srodatabase", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM npcja");
  11.  
  12. $variable = "<table>
  13. <tr>
  14. <th>npc_name</th>
  15. <th>npc_location</th>
  16. <th>npc_description</th>
  17. <th>npc_quests</th>
  18. </tr>";
  19.  
  20. while($row = mysql_fetch_array($result))
  21.   {
  22.   $variable .= "<tr>";
  23.   $variable .= "<td>" . $row['npc_name'] . "</td>";
  24.   $variable .= "<td>" . $row['npc_location'] . "</td>";
  25.   $variable .= "<td>" . $row['npc_description'] . "</td>";
  26.   $variable .= "<td>" . $row['npc_quests'] . "</td>";
  27.   $variable .= "</tr>";
  28.   }
  29. $variable .= "</table>";
  30.  
  31. mysql_close($con);
  32. ?>

Hope that this helps
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

take a look here http://www.greatnova.com/sro/styles/SF_ ... pcjadb.php thats the table i want to show up on this page here http://www.greatnova.com/sro/npcja.php

but it is not..
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

If you want to do it your way, then go to the administration control panel in your PHPBB installation and under Security Settings there would be an option to allow PHP codes in template files. By default it is set to 'No'... set it to 'Yes'.

But I still recommend you do what I suggested.
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

[quote="Bogey"]Instead of the inclusion in the HTML file you can put {NPCJADB} and in the npcja.php file you could have the following:

Code: [ Select ]
<?php
include(npcjadb.php);
$template->assign_vars(array(
     'NPCJADB' => $variable
));
?>
  1. <?php
  2. include(npcjadb.php);
  3. $template->assign_vars(array(
  4.      'NPCJADB' => $variable
  5. ));
  6. ?>


where do i place this stuff at? sorry i am confused
i did the other part with the $variable but now this page shows up with nothing on it http://www.greatnova.com/sro/styles/SF_ ... pcjadb.php and still the other page is the same.

thanks so far..

oh a little side question.. i have the image url in the database is there a way to ad that so the image shows up.. i tried but failed..
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

You have to echo $variable to get it to show up. All of that HTML code is being saved to variable. Just echo the variable and you will see it there...

Concerning the images, if the information stored in the database is just a URL to the Image, if the table name where the URL is stored is named 'image' you would have something like the following:
Code: [ Select ]
<?php
$var = '<img src="'. $row['image'] .'" alt="image" />';
?>
  1. <?php
  2. $var = '<img src="'. $row['image'] .'" alt="image" />';
  3. ?>
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

here is what i have now

npcja.php
Code: [ Select ]
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
 
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
 
page_header('NPC JA');
 
$template->set_filenames(array(
    'body' => 'npcja.html',
));
 
include(npcjadb.php);
$template->assign_vars(array(
     'NPCJADB' => $variable
));
 
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
 
?>
  1. <?php
  2. define('IN_PHPBB', true);
  3. $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
  4. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  5. include($phpbb_root_path . 'common.' . $phpEx);
  6.  
  7. // Start session management
  8. $user->session_begin();
  9. $auth->acl($user->data);
  10. $user->setup();
  11.  
  12. page_header('NPC JA');
  13.  
  14. $template->set_filenames(array(
  15.     'body' => 'npcja.html',
  16. ));
  17.  
  18. include(npcjadb.php);
  19. $template->assign_vars(array(
  20.      'NPCJADB' => $variable
  21. ));
  22.  
  23. make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
  24. page_footer();
  25.  
  26. ?>


npcja.html
Code: [ Select ]
<!-- DEFINE $S_IN_PORTAL = 1 -->
<!-- INCLUDE overall_header.html -->
 
<!-- $Id: portal_body.html,v 1.1 2008/02/09 08:18:16 angelside Exp $ //-->
<style type="text/css">
<!--
.topiclist dd.posts_portal {
    float:left;
    text-align:left;
    font-size: 1.1em;
    padding:6px 5px 6px 5px;
}
 
ul.topiclist dt {
    float:left;
    width: 90%;
    font-size: 1em;
}
 
.gensmall {
    margin: 1px 1px;
    font-size: 10px;
}
 
small, .small {
    font-size:10px;
    font-weight:bold;
    font-family:Arial, Helvetica, sans-serif;
}
 
/* Container for sub-navigation list */
#navigation {
    padding-top: 0px;
    font-size: 1.1em;
}
 
/* Link styles for the sub-section links */
#navigation a {
    color: #105289;
    font-weight: normal;
    padding: 2px;
    background: #ecf1f3 none repeat-y 100% 0;
}
 
#navigation a:hover {
    background-color: #F9F9F9;
    color: #d31141;
}
 
/* News listing */
ul.news {
    border-top: 1px solid #FFFFFF;
    list-style: none;
    margin-left: 0;
}
ul.news li {
    padding: 5px 0 4px 0;
    border-bottom: 1px solid #CCCCCC;
}
ul.news li.last {
    border-bottom: none;
}
ul.news {
    border-top: none;
}
ul.news li {
    padding: 0 0 4px 0;
    margin-bottom: 5px;
    margin-left: 0;
    border-bottom-color: #E0E0E0;
}
 
.postbody_portal {
    width: 100%;
}
//-->
</style>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<!-- [+] left block area -->
    <td width="190" valign="top" style="padding-right:6px;">
   
        <!-- INCLUDE portal/block/main_menu.html -->
       
        <!-- IF S_DISPLAY_SEARCH -->
            <!-- INCLUDE portal/block/search.html -->
        <!-- ENDIF -->
 
        <!-- IF S_ADS_SMALL -->
            <!-- INCLUDE portal/block/ads_small.html -->
        <!-- ENDIF -->
   
        <!-- IF S_DISPLAY_CHANGE_STYLE -->
            <!-- INCLUDE portal/block/change_style.html -->
        <!-- ENDIF -->
       
        <!-- IF S_DISPLAY_PAY_S -->
            <!-- INCLUDE portal/block/donation/donation_small.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_LATEST_MEMBERS -->
            <!-- INCLUDE portal/block/latest_members.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_TOP_POSTERS -->
            <!-- INCLUDE portal/block/top_poster.html -->
        <!-- ENDIF -->
       
        <!-- IF S_DISPLAY_RANDOM_MEMBER -->
            <!-- INCLUDE portal/block/random_member.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_CLOCK -->
            <!-- INCLUDE portal/block/clock.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_MINICAL -->        
            <!-- INCLUDE portal/block/mini_calendar.html -->
        <!-- ENDIF -->     
 
        <!-- IF S_DISPLAY_LINK_US -->
            <!-- INCLUDE portal/block/link_us.html -->
        <!-- ENDIF -->     
 
        <!-- IF S_DISPLAY_LINKS -->
            <!-- INCLUDE portal/block/links.html -->
        <!-- ENDIF -->     
 
        <!-- IF S_DISPLAY_LAST_BOTS and S_LAST_VISITED_BOTS -->
            <!-- INCLUDE portal/block/latest_bots.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
            <!-- INCLUDE portal/block/birthday_list.html -->
        <!-- ENDIF -->
 
        <!-- IF not S_USER_LOGGED_IN -->
        <!-- INCLUDE portal/block/login_box.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_ADVANCED_STAT -->
        <!-- INCLUDE portal/block/statistics.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_ONLINE_LIST -->
        <!-- INCLUDE portal/block/whois_online.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_LEADERS -->
        <!-- INCLUDE portal/block/leaders.html -->
        <!-- ENDIF -->     
       
        <!-- INCLUDE portal/block/ads_long.html -->
       
        <!--INCLUDE portal/block/_sample_block_design.html-->
 
    </td>
<!-- [-] left block area -->
    <td width="4" valign="top"></td>
 
<!-- [+] center block area -->
    <td valign="top">
   
   
        <!-- INCLUDE portal/block/ads_center.html -->
 
 
<h3>NPC Jangan</h3>
 
<div class="post bg2">
    <div class="inner"><span class="corners-top"><span></span></span>
    <div class="postbody postbody_portal">
 
{NPCJADB}
!-- INCLUDE {NPCJADB} -->
 
 
 
    </div>
    <div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
    <span class="corners-bottom"><span></span></span></div>
</div>
 
<hr class="divider" />
 
 
 
            <!-- INCLUDE portal/block/ads_center.html -->
 
   
 
    </td>
<!-- [-] center block area -->
    <td width="4" valign="top"></td>
</tr>
</table>
<!--// phpBB3 Portal by Sevdin Filiz, http://www.phpbb3portal.com //-->
<!-- INCLUDE overall_footer.html -->
  1. <!-- DEFINE $S_IN_PORTAL = 1 -->
  2. <!-- INCLUDE overall_header.html -->
  3.  
  4. <!-- $Id: portal_body.html,v 1.1 2008/02/09 08:18:16 angelside Exp $ //-->
  5. <style type="text/css">
  6. <!--
  7. .topiclist dd.posts_portal {
  8.     float:left;
  9.     text-align:left;
  10.     font-size: 1.1em;
  11.     padding:6px 5px 6px 5px;
  12. }
  13.  
  14. ul.topiclist dt {
  15.     float:left;
  16.     width: 90%;
  17.     font-size: 1em;
  18. }
  19.  
  20. .gensmall {
  21.     margin: 1px 1px;
  22.     font-size: 10px;
  23. }
  24.  
  25. small, .small {
  26.     font-size:10px;
  27.     font-weight:bold;
  28.     font-family:Arial, Helvetica, sans-serif;
  29. }
  30.  
  31. /* Container for sub-navigation list */
  32. #navigation {
  33.     padding-top: 0px;
  34.     font-size: 1.1em;
  35. }
  36.  
  37. /* Link styles for the sub-section links */
  38. #navigation a {
  39.     color: #105289;
  40.     font-weight: normal;
  41.     padding: 2px;
  42.     background: #ecf1f3 none repeat-y 100% 0;
  43. }
  44.  
  45. #navigation a:hover {
  46.     background-color: #F9F9F9;
  47.     color: #d31141;
  48. }
  49.  
  50. /* News listing */
  51. ul.news {
  52.     border-top: 1px solid #FFFFFF;
  53.     list-style: none;
  54.     margin-left: 0;
  55. }
  56. ul.news li {
  57.     padding: 5px 0 4px 0;
  58.     border-bottom: 1px solid #CCCCCC;
  59. }
  60. ul.news li.last {
  61.     border-bottom: none;
  62. }
  63. ul.news {
  64.     border-top: none;
  65. }
  66. ul.news li {
  67.     padding: 0 0 4px 0;
  68.     margin-bottom: 5px;
  69.     margin-left: 0;
  70.     border-bottom-color: #E0E0E0;
  71. }
  72.  
  73. .postbody_portal {
  74.     width: 100%;
  75. }
  76. //-->
  77. </style>
  78.  
  79. <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
  80. <tr>
  81. <!-- [+] left block area -->
  82.     <td width="190" valign="top" style="padding-right:6px;">
  83.    
  84.         <!-- INCLUDE portal/block/main_menu.html -->
  85.        
  86.         <!-- IF S_DISPLAY_SEARCH -->
  87.             <!-- INCLUDE portal/block/search.html -->
  88.         <!-- ENDIF -->
  89.  
  90.         <!-- IF S_ADS_SMALL -->
  91.             <!-- INCLUDE portal/block/ads_small.html -->
  92.         <!-- ENDIF -->
  93.    
  94.         <!-- IF S_DISPLAY_CHANGE_STYLE -->
  95.             <!-- INCLUDE portal/block/change_style.html -->
  96.         <!-- ENDIF -->
  97.        
  98.         <!-- IF S_DISPLAY_PAY_S -->
  99.             <!-- INCLUDE portal/block/donation/donation_small.html -->
  100.         <!-- ENDIF -->
  101.  
  102.         <!-- IF S_DISPLAY_LATEST_MEMBERS -->
  103.             <!-- INCLUDE portal/block/latest_members.html -->
  104.         <!-- ENDIF -->
  105.  
  106.         <!-- IF S_DISPLAY_TOP_POSTERS -->
  107.             <!-- INCLUDE portal/block/top_poster.html -->
  108.         <!-- ENDIF -->
  109.        
  110.         <!-- IF S_DISPLAY_RANDOM_MEMBER -->
  111.             <!-- INCLUDE portal/block/random_member.html -->
  112.         <!-- ENDIF -->
  113.  
  114.         <!-- IF S_DISPLAY_CLOCK -->
  115.             <!-- INCLUDE portal/block/clock.html -->
  116.         <!-- ENDIF -->
  117.  
  118.         <!-- IF S_DISPLAY_MINICAL -->        
  119.             <!-- INCLUDE portal/block/mini_calendar.html -->
  120.         <!-- ENDIF -->     
  121.  
  122.         <!-- IF S_DISPLAY_LINK_US -->
  123.             <!-- INCLUDE portal/block/link_us.html -->
  124.         <!-- ENDIF -->     
  125.  
  126.         <!-- IF S_DISPLAY_LINKS -->
  127.             <!-- INCLUDE portal/block/links.html -->
  128.         <!-- ENDIF -->     
  129.  
  130.         <!-- IF S_DISPLAY_LAST_BOTS and S_LAST_VISITED_BOTS -->
  131.             <!-- INCLUDE portal/block/latest_bots.html -->
  132.         <!-- ENDIF -->
  133.  
  134.         <!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
  135.             <!-- INCLUDE portal/block/birthday_list.html -->
  136.         <!-- ENDIF -->
  137.  
  138.         <!-- IF not S_USER_LOGGED_IN -->
  139.         <!-- INCLUDE portal/block/login_box.html -->
  140.         <!-- ENDIF -->
  141.  
  142.         <!-- IF S_DISPLAY_ADVANCED_STAT -->
  143.         <!-- INCLUDE portal/block/statistics.html -->
  144.         <!-- ENDIF -->
  145.  
  146.         <!-- IF S_DISPLAY_ONLINE_LIST -->
  147.         <!-- INCLUDE portal/block/whois_online.html -->
  148.         <!-- ENDIF -->
  149.  
  150.         <!-- IF S_DISPLAY_LEADERS -->
  151.         <!-- INCLUDE portal/block/leaders.html -->
  152.         <!-- ENDIF -->     
  153.        
  154.         <!-- INCLUDE portal/block/ads_long.html -->
  155.        
  156.         <!--INCLUDE portal/block/_sample_block_design.html-->
  157.  
  158.     </td>
  159. <!-- [-] left block area -->
  160.     <td width="4" valign="top"></td>
  161.  
  162. <!-- [+] center block area -->
  163.     <td valign="top">
  164.    
  165.    
  166.         <!-- INCLUDE portal/block/ads_center.html -->
  167.  
  168.  
  169. <h3>NPC Jangan</h3>
  170.  
  171. <div class="post bg2">
  172.     <div class="inner"><span class="corners-top"><span></span></span>
  173.     <div class="postbody postbody_portal">
  174.  
  175. {NPCJADB}
  176. !-- INCLUDE {NPCJADB} -->
  177.  
  178.  
  179.  
  180.     </div>
  181.     <div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
  182.     <span class="corners-bottom"><span></span></span></div>
  183. </div>
  184.  
  185. <hr class="divider" />
  186.  
  187.  
  188.  
  189.             <!-- INCLUDE portal/block/ads_center.html -->
  190.  
  191.    
  192.  
  193.     </td>
  194. <!-- [-] center block area -->
  195.     <td width="4" valign="top"></td>
  196. </tr>
  197. </table>
  198. <!--// phpBB3 Portal by Sevdin Filiz, http://www.phpbb3portal.com //-->
  199. <!-- INCLUDE overall_footer.html -->



npcjadb.php
Code: [ Select ]
<?php
$con = mysql_connect("edit","edit","edit");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
mysql_select_db("srodatabase", $con);
 
$result = mysql_query("SELECT * FROM npcja");
 
$variable = "<table>
<tr>
<th>npc_image</th>
<th>npc_name</th>
<th>npc_location</th>
<th>npc_description</th>
<th>npc_quests</th>
</tr>";
 
while($row = mysql_fetch_array($result))
  {
  $variable .= "<tr>";
  $variable .= "<td>" . $row['npc_image'] . "</td>";
  $variable .= "<td>" . $row['npc_name'] . "</td>";
  $variable .= "<td>" . $row['npc_location'] . "</td>";
  $variable .= "<td>" . $row['npc_description'] . "</td>";
  $variable .= "<td>" . $row['npc_quests'] . "</td>";
  $variable .= "</tr>";
  }
$variable .= "</table>";
 
mysql_close($con);
?>
  1. <?php
  2. $con = mysql_connect("edit","edit","edit");
  3. if (!$con)
  4.   {
  5.   die('Could not connect: ' . mysql_error());
  6.   }
  7.  
  8. mysql_select_db("srodatabase", $con);
  9.  
  10. $result = mysql_query("SELECT * FROM npcja");
  11.  
  12. $variable = "<table>
  13. <tr>
  14. <th>npc_image</th>
  15. <th>npc_name</th>
  16. <th>npc_location</th>
  17. <th>npc_description</th>
  18. <th>npc_quests</th>
  19. </tr>";
  20.  
  21. while($row = mysql_fetch_array($result))
  22.   {
  23.   $variable .= "<tr>";
  24.   $variable .= "<td>" . $row['npc_image'] . "</td>";
  25.   $variable .= "<td>" . $row['npc_name'] . "</td>";
  26.   $variable .= "<td>" . $row['npc_location'] . "</td>";
  27.   $variable .= "<td>" . $row['npc_description'] . "</td>";
  28.   $variable .= "<td>" . $row['npc_quests'] . "</td>";
  29.   $variable .= "</tr>";
  30.   }
  31. $variable .= "</table>";
  32.  
  33. mysql_close($con);
  34. ?>


and now i get this:
Code: [ Select ]
[phpBB Debug] PHP Notice: in file /npcja.php on line 18: include(npcjadbphp) [function.include]: failed to open stream: No such file or directory
[phpBB Debug] PHP Notice: in file /npcja.php on line 18: include() [function.include]: Failed opening 'npcjadbphp' for inclusion (include_path='.:/usr/local/php5/lib/php')
  1. [phpBB Debug] PHP Notice: in file /npcja.php on line 18: include(npcjadbphp) [function.include]: failed to open stream: No such file or directory
  2. [phpBB Debug] PHP Notice: in file /npcja.php on line 18: include() [function.include]: Failed opening 'npcjadbphp' for inclusion (include_path='.:/usr/local/php5/lib/php')
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

Bogey wrote:
You have to echo $variable to get it to show up. All of that HTML code is being saved to variable. Just echo the variable and you will see it there...


can you show me what you mean.. i don't quite have the hang of this yet..
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

I'm sorry, instead of include(npcjadb.php); put include('npcjadb.php'); (Those quotes)

In your HTML, remove !-- INCLUDE {NPCJADB} -->
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

npcja.php
Code: [ Select ]
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
 
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
 
page_header('NPC JA');
 
$template->set_filenames(array(
    'body' => 'npcja.html',
));
 
$con = mysql_connect("edit","edit","edit"); //From here
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("srodatabase", $con);

$result = mysql_query("SELECT * FROM npcja");

$variable = "<table>
<tr>
<th>npc_image</th>
<th>npc_name</th>
<th>npc_location</th>
<th>npc_description</th>
<th>npc_quests</th>
</tr>";

while($row = mysql_fetch_array($result))
{
$variable .= "<tr>";
$variable .= "<td>" . $row['npc_image'] . "</td>";
$variable .= "<td>" . $row['npc_name'] . "</td>";
$variable .= "<td>" . $row['npc_location'] . "</td>";
$variable .= "<td>" . $row['npc_description'] . "</td>";
$variable .= "<td>" . $row['npc_quests'] . "</td>";
$variable .= "</tr>";
}
$variable .= "</table>";

mysql_close($con); // to here

$template->assign_vars(array(
     'NPCJADB' => $variable
));
 
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
 
?>
  1. <?php
  2. define('IN_PHPBB', true);
  3. $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
  4. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  5. include($phpbb_root_path . 'common.' . $phpEx);
  6.  
  7. // Start session management
  8. $user->session_begin();
  9. $auth->acl($user->data);
  10. $user->setup();
  11.  
  12. page_header('NPC JA');
  13.  
  14. $template->set_filenames(array(
  15.     'body' => 'npcja.html',
  16. ));
  17.  
  18. $con = mysql_connect("edit","edit","edit"); //From here
  19. if (!$con)
  20. {
  21. die('Could not connect: ' . mysql_error());
  22. }
  23. mysql_select_db("srodatabase", $con);
  24. $result = mysql_query("SELECT * FROM npcja");
  25. $variable = "<table>
  26. <tr>
  27. <th>npc_image</th>
  28. <th>npc_name</th>
  29. <th>npc_location</th>
  30. <th>npc_description</th>
  31. <th>npc_quests</th>
  32. </tr>";
  33. while($row = mysql_fetch_array($result))
  34. {
  35. $variable .= "<tr>";
  36. $variable .= "<td>" . $row['npc_image'] . "</td>";
  37. $variable .= "<td>" . $row['npc_name'] . "</td>";
  38. $variable .= "<td>" . $row['npc_location'] . "</td>";
  39. $variable .= "<td>" . $row['npc_description'] . "</td>";
  40. $variable .= "<td>" . $row['npc_quests'] . "</td>";
  41. $variable .= "</tr>";
  42. }
  43. $variable .= "</table>";
  44. mysql_close($con); // to here
  45. $template->assign_vars(array(
  46.      'NPCJADB' => $variable
  47. ));
  48.  
  49. make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
  50. page_footer();
  51.  
  52. ?>


npcja.html
Code: [ Select ]
<!-- DEFINE $S_IN_PORTAL = 1 -->
<!-- INCLUDE overall_header.html -->
 
<!-- $Id: portal_body.html,v 1.1 2008/02/09 08:18:16 angelside Exp $ //-->
<style type="text/css">
<!--
.topiclist dd.posts_portal {
    float:left;
    text-align:left;
    font-size: 1.1em;
    padding:6px 5px 6px 5px;
}
 
ul.topiclist dt {
    float:left;
    width: 90%;
    font-size: 1em;
}
 
.gensmall {
    margin: 1px 1px;
    font-size: 10px;
}
 
small, .small {
    font-size:10px;
    font-weight:bold;
    font-family:Arial, Helvetica, sans-serif;
}
 
/* Container for sub-navigation list */
#navigation {
    padding-top: 0px;
    font-size: 1.1em;
}
 
/* Link styles for the sub-section links */
#navigation a {
    color: #105289;
    font-weight: normal;
    padding: 2px;
    background: #ecf1f3 none repeat-y 100% 0;
}
 
#navigation a:hover {
    background-color: #F9F9F9;
    color: #d31141;
}
 
/* News listing */
ul.news {
    border-top: 1px solid #FFFFFF;
    list-style: none;
    margin-left: 0;
}
ul.news li {
    padding: 5px 0 4px 0;
    border-bottom: 1px solid #CCCCCC;
}
ul.news li.last {
    border-bottom: none;
}
ul.news {
    border-top: none;
}
ul.news li {
    padding: 0 0 4px 0;
    margin-bottom: 5px;
    margin-left: 0;
    border-bottom-color: #E0E0E0;
}
 
.postbody_portal {
    width: 100%;
}
//-->
</style>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<!-- [+] left block area -->
    <td width="190" valign="top" style="padding-right:6px;">
   
        <!-- INCLUDE portal/block/main_menu.html -->
       
        <!-- IF S_DISPLAY_SEARCH -->
            <!-- INCLUDE portal/block/search.html -->
        <!-- ENDIF -->
 
        <!-- IF S_ADS_SMALL -->
            <!-- INCLUDE portal/block/ads_small.html -->
        <!-- ENDIF -->
   
        <!-- IF S_DISPLAY_CHANGE_STYLE -->
            <!-- INCLUDE portal/block/change_style.html -->
        <!-- ENDIF -->
       
        <!-- IF S_DISPLAY_PAY_S -->
            <!-- INCLUDE portal/block/donation/donation_small.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_LATEST_MEMBERS -->
            <!-- INCLUDE portal/block/latest_members.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_TOP_POSTERS -->
            <!-- INCLUDE portal/block/top_poster.html -->
        <!-- ENDIF -->
       
        <!-- IF S_DISPLAY_RANDOM_MEMBER -->
            <!-- INCLUDE portal/block/random_member.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_CLOCK -->
            <!-- INCLUDE portal/block/clock.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_MINICAL -->        
            <!-- INCLUDE portal/block/mini_calendar.html -->
        <!-- ENDIF -->     
 
        <!-- IF S_DISPLAY_LINK_US -->
            <!-- INCLUDE portal/block/link_us.html -->
        <!-- ENDIF -->     
 
        <!-- IF S_DISPLAY_LINKS -->
            <!-- INCLUDE portal/block/links.html -->
        <!-- ENDIF -->     
 
        <!-- IF S_DISPLAY_LAST_BOTS and S_LAST_VISITED_BOTS -->
            <!-- INCLUDE portal/block/latest_bots.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
            <!-- INCLUDE portal/block/birthday_list.html -->
        <!-- ENDIF -->
 
        <!-- IF not S_USER_LOGGED_IN -->
        <!-- INCLUDE portal/block/login_box.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_ADVANCED_STAT -->
        <!-- INCLUDE portal/block/statistics.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_ONLINE_LIST -->
        <!-- INCLUDE portal/block/whois_online.html -->
        <!-- ENDIF -->
 
        <!-- IF S_DISPLAY_LEADERS -->
        <!-- INCLUDE portal/block/leaders.html -->
        <!-- ENDIF -->     
       
        <!-- INCLUDE portal/block/ads_long.html -->
       
        <!--INCLUDE portal/block/_sample_block_design.html-->
 
    </td>
<!-- [-] left block area -->
    <td width="4" valign="top"></td>
 
<!-- [+] center block area -->
    <td valign="top">
   
   
        <!-- INCLUDE portal/block/ads_center.html -->
 
 
<h3>NPC Jangan</h3>
 
<div class="post bg2">
    <div class="inner"><span class="corners-top"><span></span></span>
    <div class="postbody postbody_portal">
 
{NPCJADB}
 
    </div>
    <div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
    <span class="corners-bottom"><span></span></span></div>
</div>
 
<hr class="divider" />
 
 
 
            <!-- INCLUDE portal/block/ads_center.html -->
 
   
 
    </td>
<!-- [-] center block area -->
    <td width="4" valign="top"></td>
</tr>
</table>
<!--// phpBB3 Portal by Sevdin Filiz, http://www.phpbb3portal.com //-->
<!-- INCLUDE overall_footer.html -->
  1. <!-- DEFINE $S_IN_PORTAL = 1 -->
  2. <!-- INCLUDE overall_header.html -->
  3.  
  4. <!-- $Id: portal_body.html,v 1.1 2008/02/09 08:18:16 angelside Exp $ //-->
  5. <style type="text/css">
  6. <!--
  7. .topiclist dd.posts_portal {
  8.     float:left;
  9.     text-align:left;
  10.     font-size: 1.1em;
  11.     padding:6px 5px 6px 5px;
  12. }
  13.  
  14. ul.topiclist dt {
  15.     float:left;
  16.     width: 90%;
  17.     font-size: 1em;
  18. }
  19.  
  20. .gensmall {
  21.     margin: 1px 1px;
  22.     font-size: 10px;
  23. }
  24.  
  25. small, .small {
  26.     font-size:10px;
  27.     font-weight:bold;
  28.     font-family:Arial, Helvetica, sans-serif;
  29. }
  30.  
  31. /* Container for sub-navigation list */
  32. #navigation {
  33.     padding-top: 0px;
  34.     font-size: 1.1em;
  35. }
  36.  
  37. /* Link styles for the sub-section links */
  38. #navigation a {
  39.     color: #105289;
  40.     font-weight: normal;
  41.     padding: 2px;
  42.     background: #ecf1f3 none repeat-y 100% 0;
  43. }
  44.  
  45. #navigation a:hover {
  46.     background-color: #F9F9F9;
  47.     color: #d31141;
  48. }
  49.  
  50. /* News listing */
  51. ul.news {
  52.     border-top: 1px solid #FFFFFF;
  53.     list-style: none;
  54.     margin-left: 0;
  55. }
  56. ul.news li {
  57.     padding: 5px 0 4px 0;
  58.     border-bottom: 1px solid #CCCCCC;
  59. }
  60. ul.news li.last {
  61.     border-bottom: none;
  62. }
  63. ul.news {
  64.     border-top: none;
  65. }
  66. ul.news li {
  67.     padding: 0 0 4px 0;
  68.     margin-bottom: 5px;
  69.     margin-left: 0;
  70.     border-bottom-color: #E0E0E0;
  71. }
  72.  
  73. .postbody_portal {
  74.     width: 100%;
  75. }
  76. //-->
  77. </style>
  78.  
  79. <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
  80. <tr>
  81. <!-- [+] left block area -->
  82.     <td width="190" valign="top" style="padding-right:6px;">
  83.    
  84.         <!-- INCLUDE portal/block/main_menu.html -->
  85.        
  86.         <!-- IF S_DISPLAY_SEARCH -->
  87.             <!-- INCLUDE portal/block/search.html -->
  88.         <!-- ENDIF -->
  89.  
  90.         <!-- IF S_ADS_SMALL -->
  91.             <!-- INCLUDE portal/block/ads_small.html -->
  92.         <!-- ENDIF -->
  93.    
  94.         <!-- IF S_DISPLAY_CHANGE_STYLE -->
  95.             <!-- INCLUDE portal/block/change_style.html -->
  96.         <!-- ENDIF -->
  97.        
  98.         <!-- IF S_DISPLAY_PAY_S -->
  99.             <!-- INCLUDE portal/block/donation/donation_small.html -->
  100.         <!-- ENDIF -->
  101.  
  102.         <!-- IF S_DISPLAY_LATEST_MEMBERS -->
  103.             <!-- INCLUDE portal/block/latest_members.html -->
  104.         <!-- ENDIF -->
  105.  
  106.         <!-- IF S_DISPLAY_TOP_POSTERS -->
  107.             <!-- INCLUDE portal/block/top_poster.html -->
  108.         <!-- ENDIF -->
  109.        
  110.         <!-- IF S_DISPLAY_RANDOM_MEMBER -->
  111.             <!-- INCLUDE portal/block/random_member.html -->
  112.         <!-- ENDIF -->
  113.  
  114.         <!-- IF S_DISPLAY_CLOCK -->
  115.             <!-- INCLUDE portal/block/clock.html -->
  116.         <!-- ENDIF -->
  117.  
  118.         <!-- IF S_DISPLAY_MINICAL -->        
  119.             <!-- INCLUDE portal/block/mini_calendar.html -->
  120.         <!-- ENDIF -->     
  121.  
  122.         <!-- IF S_DISPLAY_LINK_US -->
  123.             <!-- INCLUDE portal/block/link_us.html -->
  124.         <!-- ENDIF -->     
  125.  
  126.         <!-- IF S_DISPLAY_LINKS -->
  127.             <!-- INCLUDE portal/block/links.html -->
  128.         <!-- ENDIF -->     
  129.  
  130.         <!-- IF S_DISPLAY_LAST_BOTS and S_LAST_VISITED_BOTS -->
  131.             <!-- INCLUDE portal/block/latest_bots.html -->
  132.         <!-- ENDIF -->
  133.  
  134.         <!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
  135.             <!-- INCLUDE portal/block/birthday_list.html -->
  136.         <!-- ENDIF -->
  137.  
  138.         <!-- IF not S_USER_LOGGED_IN -->
  139.         <!-- INCLUDE portal/block/login_box.html -->
  140.         <!-- ENDIF -->
  141.  
  142.         <!-- IF S_DISPLAY_ADVANCED_STAT -->
  143.         <!-- INCLUDE portal/block/statistics.html -->
  144.         <!-- ENDIF -->
  145.  
  146.         <!-- IF S_DISPLAY_ONLINE_LIST -->
  147.         <!-- INCLUDE portal/block/whois_online.html -->
  148.         <!-- ENDIF -->
  149.  
  150.         <!-- IF S_DISPLAY_LEADERS -->
  151.         <!-- INCLUDE portal/block/leaders.html -->
  152.         <!-- ENDIF -->     
  153.        
  154.         <!-- INCLUDE portal/block/ads_long.html -->
  155.        
  156.         <!--INCLUDE portal/block/_sample_block_design.html-->
  157.  
  158.     </td>
  159. <!-- [-] left block area -->
  160.     <td width="4" valign="top"></td>
  161.  
  162. <!-- [+] center block area -->
  163.     <td valign="top">
  164.    
  165.    
  166.         <!-- INCLUDE portal/block/ads_center.html -->
  167.  
  168.  
  169. <h3>NPC Jangan</h3>
  170.  
  171. <div class="post bg2">
  172.     <div class="inner"><span class="corners-top"><span></span></span>
  173.     <div class="postbody postbody_portal">
  174.  
  175. {NPCJADB}
  176.  
  177.     </div>
  178.     <div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
  179.     <span class="corners-bottom"><span></span></span></div>
  180. </div>
  181.  
  182. <hr class="divider" />
  183.  
  184.  
  185.  
  186.             <!-- INCLUDE portal/block/ads_center.html -->
  187.  
  188.    
  189.  
  190.     </td>
  191. <!-- [-] center block area -->
  192.     <td width="4" valign="top"></td>
  193. </tr>
  194. </table>
  195. <!--// phpBB3 Portal by Sevdin Filiz, http://www.phpbb3portal.com //-->
  196. <!-- INCLUDE overall_footer.html -->


You don't even need npcjadb.php... just put that contents into npcja.php and store the results in $variable, and then store Variable into a template variable and then put that into a template.
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

it works!

now i see why it was not working.. i was adding
Code: [ Select ]
<?php
include('npcjadb.php');
?>
  1. <?php
  2. include('npcjadb.php');
  3. ?>


to the npcja.html
also i was thinking that i needed to add the sql to the the npcja.php but i did not know if the html in the code would show..

thanks so much..
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

ok one last thing about the image url..

this is what i did.
Code: [ Select ]
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
 
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
 
page_header('NPC JA');
 
$template->set_filenames(array(
    'body' => 'npcja.html',
));
 
$con = mysql_connect("**********","**********","**********");  //From here
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
mysql_select_db("srodatabase", $con);
 
$result = mysql_query("SELECT * FROM npcja");
 
$variable = "<table>
<tr>
<th>npc_image</th>
<th>npc_name</th>
<th>npc_location</th>
<th>npc_description</th>
<th>npc_quests</th>
</tr>";
 
while($row = mysql_fetch_array($result))
  {
  $variable .= "<tr>";
  $variable .= "<td><img src="" . $row['npc_image'] . "" alt="npcimage" /></td>";
  $variable .= "<td>" . $row['npc_name'] . "</td>";
  $variable .= "<td>" . $row['npc_location'] . "</td>";
  $variable .= "<td>" . $row['npc_description'] . "</td>";
  $variable .= "<td>" . $row['npc_quests'] . "</td>";
  $variable .= "</tr>";
  }
$variable .= "</table>";
 
mysql_close($con);  // to here
 
$template->assign_vars(array(
     'NPCJADB' => $variable
));
   
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
 
?>
  1. <?php
  2. define('IN_PHPBB', true);
  3. $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
  4. $phpEx = substr(strrchr(__FILE__, '.'), 1);
  5. include($phpbb_root_path . 'common.' . $phpEx);
  6.  
  7. // Start session management
  8. $user->session_begin();
  9. $auth->acl($user->data);
  10. $user->setup();
  11.  
  12. page_header('NPC JA');
  13.  
  14. $template->set_filenames(array(
  15.     'body' => 'npcja.html',
  16. ));
  17.  
  18. $con = mysql_connect("**********","**********","**********");  //From here
  19. if (!$con)
  20.   {
  21.   die('Could not connect: ' . mysql_error());
  22.   }
  23.  
  24. mysql_select_db("srodatabase", $con);
  25.  
  26. $result = mysql_query("SELECT * FROM npcja");
  27.  
  28. $variable = "<table>
  29. <tr>
  30. <th>npc_image</th>
  31. <th>npc_name</th>
  32. <th>npc_location</th>
  33. <th>npc_description</th>
  34. <th>npc_quests</th>
  35. </tr>";
  36.  
  37. while($row = mysql_fetch_array($result))
  38.   {
  39.   $variable .= "<tr>";
  40.   $variable .= "<td><img src="" . $row['npc_image'] . "" alt="npcimage" /></td>";
  41.   $variable .= "<td>" . $row['npc_name'] . "</td>";
  42.   $variable .= "<td>" . $row['npc_location'] . "</td>";
  43.   $variable .= "<td>" . $row['npc_description'] . "</td>";
  44.   $variable .= "<td>" . $row['npc_quests'] . "</td>";
  45.   $variable .= "</tr>";
  46.   }
  47. $variable .= "</table>";
  48.  
  49. mysql_close($con);  // to here
  50.  
  51. $template->assign_vars(array(
  52.      'NPCJADB' => $variable
  53. ));
  54.    
  55. make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
  56. page_footer();
  57.  
  58. ?>


gives me this
Parse error: syntax error, unexpected '"' in /home/content/j/o/h/johnathanbrook/html/sro/npcja.php on line 40

also tried this
Code: [ Select ]
 $variable .= "<td>"<img src="' . $row['npc_image'] . '" alt="npcimage" />'"</td>";


and this
Code: [ Select ]
$variable .= "<td><img src=" . $row['npc_image'] . "/></td>";
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

ok i seem to have figured it out..

i replace it with
Code: [ Select ]
$variable .= "<td width='100'><img src='". $row['npc_image'] ."'/></td>";


it seemed to have worked.. did i do it the right way?
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

Glad you got it working :) That's one of the way to do it... I would do it the following way though: (But it's not much difference then your way. Does the same thing a little different way.)
PHP Code: [ Select ]
$variable .= "<td width=\"100\"><img src=\"{$row['npc_image']}\"/></td>";
  • UniquelyYoursPC
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2997
  • Loc: Canada "A"

Post 3+ Months Ago

Bogey wrote:
Glad you got it working :) That's one of the way to do it... I would do it the following way though: (But it's not much difference then your way. Does the same thing a little different way.)
PHP Code: [ Select ]
$variable .= "<td width=\"100\"><img src=\"{$row['npc_image']}\"/></td>";


i was going to try that as well.. i was doing some searching and seen that when i have " for the html tags i need php to pass them so it would not brake the code.. and it showed 2 ways to do it.. by using ' or \ tags i went with the first one and it worked.

is there a problem with doing it with ' rather then \ ? like will it mess up on IE or is there no difference? my code is still small so i have no problem changing it if your recommend it.

btw thanks so much for your help the last few days.. i would have been lost and have given up or not nowhere by now..
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8399
  • Loc: USA

Post 3+ Months Ago

There's no difference between the both ways, I just like using ' " ' for HTML tags rather then " ' ". It's up to you.

Your welcome :)

Post Information

  • Total Posts in this topic: 16 posts
  • Users browsing this forum: No registered users and 158 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.