Neuigkeiten:

still alive...

Hauptmenü

PHP ... etwas herausfilter :-)

Begonnen von ira, 07. Januar 2007, 03:46:42

Vorheriges Thema - Nächstes Thema

ira

Sorry Jungz wusste nicht wie ich es beschreiben soll gg
 
Habe folgendes Problem
ich möchte das diese Datei die ich hier poste nur den Titel mit Link ausgibt. Was muss ich weglassen bzw was muss übrig bleiben?
 
Momentan gibt diese Script mehrere Sachen aus wie: Name, gepostet am, Voten, ID, Beschreibung, Fromat etc.
Also wie gesagt ich möchte das Sie nur ausgibt
Titel und LINK
 


Script says: \\\"I need a category to show!!!\\\" \");  
#======================================================================#
#   the includes & mySQL-conn
#======================================================================#
require(\"./inc/conf.inc.php\"); // cfg
require(\"./inc/connect.php\");    // mySQL
require(\"./lang/$language\"); // language-file
include(\"./inc/head.inc\");    // header
//set table-vars                                             
$table_linkdata = $db_prefix.\"linkdata\";                                    
$table_cat = $db_prefix.\"cat\";                                          
$table_votes = $db_prefix.\"votes\";                                       
$table_languages = $db_prefix.\"languages\";                                    
//Connect to mySQL                                             
$conn = @MYSQL_CONNECT($server, $user, $pass);                                    
//Select DB                                                
@MYSQL_SELECT_DB($mydb) or die (\"Database \'$mydb\' does not exist or mySQL is not connected!Please check your settings ...\");
//Check                                                   
if(!$conn) die(\"mySQL-Connection-ErrorCheck your settings ...\");   
#======================================================================#
#   add vote to db & check if already voted
#======================================================================#
if($yourvote)
{
//save vote in db
$sql = \"INSERT INTO $table_votes (vote, link_id, cat)\";
$sql.= \"VALUES (\'$yourvote\', \'$id\', \'$cat\')\";
MYSQL_QUERY($sql);
//vote counter +1
MYSQL_QUERY(\"UPDATE $table_linkdata SET hp_votes = hp_votes + 1 WHERE id = $id\");
// generate actual vote-count and put into \"LINKDATA-->hp_votes\"
$result = MYSQL_QUERY(\"SELECT vote FROM $table_votes WHERE link_id = $id\");
$anzahl = MYSQL_NUM_ROWS($result);
while ($row = MYSQL_FETCH_ARRAY($result)) { $allvotes = $allvotes + $row[vote]; }   // summary of votes for an id
if($anzahl == 1) $allvotes = $yourvote;                   // set $allvotes to 1, if it\'s the first one
$av_votes = round($allvotes / $anzahl, 1);                  // get &  round the average-votes
// put $av_votes to db
MYSQL_QUERY(\"UPDATE $table_linkdata SET hp_vote = $av_votes WHERE id = $id\");
 
// show auto-link if vote added
echo
 
end_xx;
echo \"\\n\".VIEW_VOTE_AUTOLINK.\"\\n\";
echo \"[ link ]\";
echo
 

end_x;
exit;
} // endif $yourvote
#======================================================================#
#   get data from db by right order ...
#======================================================================#
if(($cat) && (!$yourvote))
{
if($sort == \"new\" || $incatsort == \"id\")    { $incatsort = \"id\"; $sortby = \"DESC\"; $act_sort = VIEW_SORTING_NEW; }        //  sorting by old/new
if($sort == \"old\")             { $incatsort = \"id\"; $sortby = \"ASC\"; $act_sort = VIEW_SORTING_OLD; }
if($sort == \"vote\" || $incatsort == \"hp_vote\")    { $incatsort = \"hp_vote\"; $sortby = \"DESC\"; $act_sort = VIEW_SORT_BY_VOTE; }     //sort by rating
if($sort == \"hits\" || $incatsort == \"hp_votes\") { $incatsort = \"Hits\"; $sortby = \"DESC\"; $act_sort = VIEW_SORT_BY_HITS; }    //sort by hits
if($sort == \"name\" || $incatsort == \"name\")    { $incatsort = \"name\"; $sortby = \"ASC\"; $act_sort = VIEW_SORTING_NAME; }   //sort by name
//when searching
if($cat == \"search\") {
$result = MYSQL_QUERY(\"SELECT * FROM $table_linkdata WHERE name LIKE \\\"%$q%\\\" order by $incatsort $sortby LIMIT 0,$max_search \");  // get seach-query\'s to $max_search
$scnt = MYSQL_NUM_ROWS($result);
} else {
if(!$s) { $showfrom = 0; $datasets = $perpage;  // params for default--output (on 1 page)
} else {
$showfrom = $s; $datasets = $perpage; }   // set params for page--output (multiple pages)
// get total number of links in a cat
$countz = MYSQL_QUERY(\"SELECT COUNT(id) FROM $table_linkdata WHERE cat = $cat \");
$anz = MYSQL_RESULT($countz,0);
MYSQL_FREE_RESULT($countz); //mem
$result = MYSQL_QUERY(\"SELECT * FROM $table_linkdata WHERE cat = $cat order by $incatsort $sortby LIMIT $showfrom,$datasets \");    //get linkdata
} //endif $search
#======================================================================#
#   javascript for jump-menu
#======================================================================#
?>   
 
 
 
\'>
 
$listname | \".VIEW_BEFORE_CAT_TXT.\" \'$world[name]\'\\n\";  // print cat-info
  echo \"\\n\\n\";
  MYSQL_FREE_RESULT($hello); // give memory free
  } else {
       echo \"$listname | \".SEARCH_RESULTS.\" $q ($max_search max.)\\n\"; } // print search-resluts header
 
#======================================================================#
#   render output-table for each link
#======================================================================#
if(!$scnt && $cat == \"search\") echo SEARCH_NO_RESULTS;      // msg if no search-results found
//function to generate the -field for \'vote\'
function VoteSelect()
{
global $PHP_SELF;
global $cat;
global $row;
global $s;
//  for vote
echo \"\\t\\n\";
echo \"\\t\".VIEW_VOTE_SELECT.\"\\n\";   
echo \"\\t1 - \".VIEW_BADDEST_VOTE.\"\\n\";
echo \"\\t2\\n\";
echo \"\\t3\\n\";
echo \"\\t4\\n\";
echo \"\\t5\\n\";
echo \"\\t6\\n\";
echo \"\\t7\\n\";   
echo \"\\t8\\n\";
echo \"\\t9\\n\";
echo \"\\t10 - \".VIEW_BEST_VOTE.\"\\n\";
echo \"\\t\\n\";
}
while ($row = MYSQL_FETCH_ARRAY($result))
{
// get date of posting and format as set
if($timeformat == 1)     $pd = strftime(\"%d.%m.%Y\", $row[poster_time]);
elseif($timeformat == 2) $pd = strftime(\"%A, %d-%m-%Y %R\", $row[poster_time]);
elseif($timeformat == 3) $pd = strftime(\"%d-%m-%Y\", $row[poster_time]);
else          $pd = strftime(\"%Y-%d-%m\", $row[poster_time]);
//strip-slashes
if($html == \"ON\")
{
 $row[hp_desc]        = stripslashes($row[hp_desc]);
 $row[name]        = stripslashes($row[name]);
 $row[url]        = stripslashes($row[url]);
 $row[poster_name]  = stripslashes($row[poster_name]);
 $row[poster_email] = stripslashes($row[poster_email]);
}
// include design.inc.php and render table\'s
include(\"inc/design.inc.php\");
}
MYSQL_FREE_RESULT($result);    // give memory free
} //endif $cat
?>
 
\'>
 

 for catjump
echo VIEW_CATJUMP_SEL.\" \";
echo \"\\n\";
echo \"\".ADD_HP_CAT_SELECT.\"\\n\";
$sweet = MYSQL_QUERY(\"SELECT * FROM $table_cat order by $catorder\");
while ($cats = MYSQL_FETCH_ARRAY($sweet))   
{
if($cats[id] != $cat) echo \"$cats[name]\\n\";   // render cat-selection
}
MYSQL_FREE_RESULT($sweet); // give memory free
echo \"\\n\";
?>
 
 
\'>
 
$anz) $sh_to = $anz;               //  ---- \"\" ----
if($sort) $linkvar = \"&sort=$sort\";               // string for sorting if set
//output
if($s)    echo \"[  ] ::\\n\";   
echo \"[ \".VIEW_LINKS_PAGE.\" $actpg \".VIEW_LINKS_FROM.\" \".sprintf(\"%d\",\"$pgcnt\").\" ] \";
if($s + $perpage > ]\\n\";
} //endif $q
// HTML:
?>
 
 

© xLinks 2002\\n\";       #                                                                     #
   //disconnect from mySQL                                 #
   MYSQL_CLOSE();                                    #
#################################################################################################################
include(\"./inc/foot.inc\");
?>

 
 
 
Danke für eure Mühe

glaubst Du wirklich, dass sich jemand den ganzen Code reinzieht? ^^ /uploads/emoticons/icon_e_surprised.gif.a005678239f11b45b64b526b2c82e9a1.gif\" alt=\":o\" />

jogibär

An diesem Script muss man auch nicht mehr rumbasteln, sondern es eher wegschmeißen. Völlig veraltet und funktioniert nicht mit register_globals=off. Setzt man an den Anfang die Zeile

error_reporting(E_ALL);

 
dürfte PHP wohl meckern bis zum abwinken.
Gruß
Jogi

ira

LOWBIRDS
hier steckt es habe es schon
 

// include design.inc.php and render table\'s
include(\"inc/design.inc.php\");

all your base are belong to us / Discord