Hi michael.
I try to understand how to transform a basic php file to a ipb integrate file (i want just to dont have hany connection to database.
The file is this one (but i am not interested in this file, i whant just to print a list of one table fields.... or even just one field..... it's just for understand):
<?php
$conn= mysql_connect('localhost','ipb','ipb');
if(!$conn)die(mysql_error($conn));
$ris=mysql_select_db("ipb",$conn);
if(!$ris)die(mysql_error());
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
$idf="2";
$msg="SELECT * FROM `topics`where forum_id=$idf ORDER BY `start_date` DESC LIMIT 0, 3 ";
$query=mysql_query($msg);
if(!$query) die(mysql_error());
$l="";
while($row= mysql_fetch_assoc($query)){
//Confronto
if(strcasecmp($l,substr($row['title'],0,1))!=0){
$l=substr($row['title'],0,1);
?>
<?php
}
?>
<a href="index.php?/topic/<?php echo $row['tid']."-".$row['title'] ?>" target="_blank">
<?php echo $row['title']?></a><?php if($row['description']!="") echo ("<font color='#000000'> - ".$row['description']."</font>") ?> <?php echo $row['seo_first_name']?></br>
<?php } ?>
</body>
</html>
in first php section there is the database connection
$conn= mysql_connect('localhost','name','password');
Terabyte tell to use this:
require_once( 'initdata.php' );
require_once( CP_DIRECTORY.'/sources/base/ipsRegistry.php' );
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );
$registry = ipsRegistry::instance();
$registry->init();
and this:
ipsRegistry::DB()->funcName();
but i dont understand how to use this.
My php is very very very very low level......