.htaccess

Get general PHP programming help here.

.htaccess

Postby DUQUE » 10/26/2006 1:33 am

pgolovko, i am the webmaster of www.Seadir.com I request excuses to you to copy your design.I change the icons and colors in Seadir.

I would like to collaborate with you post code in your forum.

Sorry but my English is very bad.

Code for .htaccess

Url Friendly to Search Engines, and other Characteristics

Code: Select all
RewriteEngine On
Rewriterule ^(.*)\.html$ ?catid=$1
RewriteCond %{HTTP_HOST} !^www\.youdomain\.com$
RewriteRule ^(.*)$ http://www.youdomain.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
AddCharset UTF-8 .html


Thank you for all
DUQUE
 
Posts: 15
Joined: 10/26/2006 1:08 am


Postby pgolovko » 10/26/2006 3:25 pm

I've seen the changes on your site, it was not really too big of a deal as I had plans to redistribute the template with ADP anyways. I've decided to write my own directory/search/spider engine, faster and far more advanced than Sphider. It isnt ready yet, but if you're interested you can take a look at the preview: http://www.astanda.com/adp/

By the way, was that .htaccess file for Sphider?
User avatar
pgolovko
 
Posts: 494
Joined: 03/25/2006 1:23 am
Location: Somewhere on planet Earth ....

Last Search

Postby DUQUE » 10/30/2006 4:49 am

I have created it .htaccess

Code for Last Search and Most Search.


Code: Select all


<?php;


$include_dir = "./include";

include ("$include_dir/commonfuncs.php");

extract(getHttpVars());

$include_dir = "./include";

$template_dir = "./templates";

$settings_dir = "./settings";

$language_dir = "./languages";



require_once("$settings_dir/database.php");

require_once("$language_dir/en-language.php");

require_once("$include_dir/searchfuncs.php");

require_once("$include_dir/categoryfuncs.php");







include "$settings_dir/conf.php";



include "$template_dir/$template/header.html";

include "$language_dir/$language-language.php";







   function list_cats($parent, $lev, $color, $message) {



      global $mysql_table_prefix;

      if ($lev == 0) {

         print "\n";

      }

      $space = "";

      for ($x = 0; $x < $lev; $x++)

         $space .= "&nbsp;&nbsp;&nbsp;·&nbsp;";



      $query = "SELECT * FROM ".$mysql_table_prefix."categories WHERE parent_num=$parent ORDER BY category LIMIT 0 , 300";

      $result = mysql_query($query);

      echo mysql_error();

      

      if (mysql_num_rows($result) <> '')

         while ($row = mysql_fetch_array($result)) {

   

            $id = $row['category_id'];

            $cat = $row['category'];

            print "<option value=\"".$id."\">".$space.stripslashes($cat)."</option>\n";

   

            $color = list_cats($id, $lev + 1, $color, "");

         }



      return $color;



   }





?>



&nbsp;

<div align="center"></div>
<div align="center">

  <center>

  <table border="0" width="85%" cellspacing="0" cellpadding="0">

    <tr>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

    </tr>

    <tr>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

      <td width="100%" bgcolor="#FFFFFF">

        <div align="center">

          <table width="100%"  border="0">
            <tr>
              <td width="50%"><div align="center"><strong>Top Consultas (veces)</strong></div></td>
              <td width="50%"><div align="center"><strong>&Uacute;ltimas Consultas (tiempo)</strong> </div></td>
            </tr>
          </table>
          <table border="0" width="95%" cellpadding="2">

            <tr>
              <td width="50%">
                <div>
                  <div align="center">
                    <p>&nbsp;</p>
                    <p>
                      <?php
include("settings/database.php");
$result = mysql_query("SELECT query, COUNT(*) AS c, DATE_FORMAT(MAX(time),'%d-%m-%Y %H:%i:%s'), AVG(results) FROM query_log GROUP BY query ORDER BY c DESC LIMIT 10");
echo mysql_error();
while($row = mysql_fetch_row($result)) {
   $word = $row[0];
   $times = $row[1];
   $date = $row[2];
   $avg = number_format($row[3], 1);
   if(trim($word) == "") {
?>
</p>
                    <p><a href="/index.php?search=1&query="><em>(nada)</em></a> (
                        <?= $times; ?>
        )</p>
                  </div>
                </div>
                <div></div>
                <div align="center">
                  <?php
   } else {
?>
                </div>
                <div>
                  <div align="center"><a href="/index.php?search=1&query=<?= $word; ?>">
                    <?= $word; ?>
                    </a> (
                    <?= $times; ?>
      )</div>
                </div>
                <div align="center">
                  <?php
   }
}         
?>            <br>
              <br>
              </div></td>
              <td width="50%">
           <div>
              <div align="center"></div>
              <div align="center">
<p>
                    <?php
include("settings/database.php");
$result = mysql_query("SELECT query, DATE_FORMAT(time, '%Y-%m-%d %H:%i:%s'), elapsed, results FROM query_log ORDER BY time DESC LIMIT 10");
echo mysql_error();
while($row = mysql_fetch_row($result)) {
   $word = $row[0];
   $time = $row[1];
   $elapsed = $row[2];
   $results = $row[3];
   if(trim($word) == "") {
?>
                  </div>
                  <div>
                    <div align="center"><a href="/index.php?search=1&query="><em>(nada)</em></a> (
                        <?= $elapsed; ?>
      )</div>
                  </div>
                  <div align="center">
                    <?php
   } else {
?>
                  </div>
                  <div>
                    <div align="center"><a href="/index.php?search=1&query=<?= $word; ?>">
                      <?= $word; ?>
                      </a> (
                      <?= $elapsed; ?>
      )</div>
                  </div>
                  <div align="center">
                    <?php
   }
}         
?>
&nbsp;
    <p></p>
                </div></td>

              </tr>

          </table>
        </div>

      </td>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

    </tr>

    <tr>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

    </tr>

  </table>

  </center>

</div>

               

<P><img border="0" src="/images/pixel.gif" width="1" height="1"></P>
<td bgcolor="#0000FF">&nbsp;</td>

    </tr>

    <tr>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

    </tr>
<CENTER>
</CENTER>









<?



include "$template_dir/$template/footer.html";



?>
<div align="center">
  <table border="0" width="85%" cellspacing="0" cellpadding="0">

    <tr>
      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>
      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>
      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>
    </tr>
    <tr>
      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>
      <td width="100%" bgcolor="#FFFFFF">
        <div align="center">

          <center>
          <table border="0" width="90%" cellpadding="2">
            <tr>
              <td width="50%"><font color="#0000FF" size="1">               <a href="/addurl1.php" title="Sugerir Enlace"><font color="#0000FF"><strong>Sugerir Enlace</strong></font></a>
               ·<strong> <a href="/categorias.php" title="Sugerir Categoría"><font color="#0000FF">Sugerir Categoría</font></a></strong>
               &middot;<strong><a href="/consultas.php" title="Consultas"><font color="#0000FF"> Consultas</font></a></strong> </font></td>
                  <td width="50%" align="right" nowrap><font size="1" color="#0000FF">
<?

function getStatistics() {

      global $mysql_table_prefix;

      $stats = array();

      $keywordQuery = "select count(keyword_id) from ".$mysql_table_prefix."keywords";

      $linksQuery = "select count(url) from ".$mysql_table_prefix."links";

      $siteQuery = "select count(site_id) from ".$mysql_table_prefix."sites";

      $categoriesQuery = "select count(category_id) from ".$mysql_table_prefix."categories";



      $result = mysql_query($keywordQuery);

      echo mysql_error();

      if ($row=mysql_fetch_array($result)) {

         $stats['keywords']=$row[0];

      }

      $result = mysql_query($linksQuery);

      echo mysql_error();

      if ($row=mysql_fetch_array($result)) {

         $stats['links']=$row[0];

      }

      for ($i=0;$i<=15; $i++) {

         $char = dechex($i);

         $result = mysql_query("select count(link_id) from ".$mysql_table_prefix."link_keyword$char");

         echo mysql_error();

         if ($row=mysql_fetch_array($result)) {

            $stats['index']+=$row[0];

         }

      }

      $result = mysql_query($siteQuery);

      echo mysql_error();

      if ($row=mysql_fetch_array($result)) {

         $stats['sites']=$row[0];

      }

      $result = mysql_query($categoriesQuery);

      echo mysql_error();

      if ($row=mysql_fetch_array($result)) {

         $stats['categories']=$row[0];

      }

      return $stats;

   }



?>
<?

$stats = getStatistics();

   print "<p>Actualmente en la base de datos: </strong>".$stats['sites']." Sitios, ".$stats['links']." Enlaces, ".$stats['categories']." Categorias y ".$stats['keywords']." Palabras.</p>\n";

?>

            </font></td>
              </tr>
          </table>

          </center>
        </div>
      </td>
      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>
    </tr>
    <tr>
      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>
      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>
      <td bgcolor="#0000FF"><img border="0" src="/images/pixel.gif" width="1" height="1"></td>

    </tr>
    <tr>
      <td></td>
  </center>
      <td><br />
        <p align="center"><font size="1" color="#999999">©
                Copyright 2006, Seadir.com</font></td>
  <center>
      <td></td>

    </tr>
  </table>
   <br />

         <?print $sph_messages['Powered by'];?> <a href="http://www.seadir.com/"><img src="/images/Seadir.gif"  border="0" style="vertical-align: middle" title="Seadir Buscador y Directorio Web" alt="Seadir Buscador y Directorio Web"></a>
         <?print $sph_messages['Page Rank'];?> <a title="Another PageRank Monitor ™" href="http://www.maxglaser.net/lista-herramientas/pagerank-monitor/" target="_blank" ><img src="http://www.maxglaser.net/pr.php?g=1&u=http://www.seadir.com" border="0" style="vertical-align: middle"></a>


</div>
DUQUE
 
Posts: 15
Joined: 10/26/2006 1:08 am


Return to PHP Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron