2013-05-07 14:20:08 -04:00
< ?
//require("include/top.php");
require ( " include/misc.php " );
require ( " include/top.php " );
require ( " include/libbb.php " );
2013-05-07 23:27:41 -04:00
function cmp_avg ( $a , $b )
2013-05-07 14:20:08 -04:00
{
if ( $a [ " avg_rating " ] == $b [ " avg_rating " ])
{
return 0 ;
}
return ( $a [ " avg_rating " ] > $b [ " avg_rating " ]) ? - 1 : 1 ;
}
2013-05-07 23:27:41 -04:00
function cmp_avg_rev ( $a , $b )
2013-05-07 14:20:08 -04:00
{
if ( $a [ " avg_rating " ] == $b [ " avg_rating " ])
{
return 0 ;
}
return ( $a [ " avg_rating " ] < $b [ " avg_rating " ]) ? - 1 : 1 ;
}
2013-05-07 23:27:41 -04:00
function cmp_tot ( $a , $b )
2013-05-07 14:20:08 -04:00
{
if ( $a [ " total " ] == $b [ " total " ])
{
return 0 ;
}
return ( $a [ " total " ] > $b [ " total " ]) ? - 1 : 1 ;
}
$posts_per_page = $user [ " searchprods " ] ? $user [ " searchprods " ] : 10 ;
if (( $type != " prod " ) && ( $type != " group " ) && ( $type != " party " ) && ( $type != " board " ) && ( $type != " user " ) && ( $type != " bbs " )) {
$type = " prod " ;
}
$what = trim ( $what );
if ( $what ) {
conn_db ();
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
$mywhat = strtr ( $what , " " , " % " );
$subquery = " % " . $mywhat . " % " ;
if ( $type == " prod " ) {
$query = " SELECT count(0) FROM prods WHERE prods.name LIKE ' " . $subquery . " ' " ;
$result = mysql_query ( $query );
$nb_posts = mysql_result ( $result , 0 );
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
if (( $page <= 0 ) || ( ! $page )) {
$page = 1 ; //ceil($nb_posts/$posts_per_page);
}
$query = " SELECT prods.id,prods.name,prods.views,prods.type,prods.date,prods.party,prods.party_year,prods.party_place,prods.partycompo,prods.group1,prods.group2,prods.group3,parties1.name as partyname FROM prods LEFT JOIN parties as parties1 ON parties1.id=prods.party WHERE prods.name LIKE ' " . $subquery . " ' ORDER BY name " ;
$query .= " LIMIT " . (( $page - 1 ) * $posts_per_page ) . " , " . $posts_per_page ;
} elseif ( $type == " group " ) {
$query = " SELECT count(0) FROM groups WHERE name LIKE ' " . $subquery . " ' OR acronym LIKE ' " . $subquery . " ' " ;
$result = mysql_query ( $query );
$nb_posts = mysql_result ( $result , 0 );
if (( $page <= 0 ) || ( ! $page )) {
$page = 1 ; //ceil($nb_posts/$posts_per_page);
}
$query = " SELECT id,name,acronym,web FROM groups WHERE name LIKE ' " . $subquery . " ' OR acronym LIKE ' " . $subquery . " ' ORDER BY name " ;
$query .= " LIMIT " . (( $page - 1 ) * $posts_per_page ) . " , " . $posts_per_page ;
} elseif ( $type == 'party' ) {
$query = " SELECT count(0) FROM parties WHERE name LIKE ' " . $subquery . " ' " ;
$result = mysql_query ( $query );
$nb_posts = mysql_result ( $result , 0 );
if (( $page <= 0 ) || ( ! $page )) {
$page = 1 ; //ceil($nb_posts/$posts_per_page);
}
$query = " SELECT id,name,web FROM parties WHERE name LIKE ' " . $subquery . " ' ORDER BY name " ;
$query .= " LIMIT " . (( $page - 1 ) * $posts_per_page ) . " , " . $posts_per_page ;
} elseif ( $type == 'board' ) {
$query = " SELECT count(0) FROM bbses WHERE name LIKE ' " . $subquery . " ' OR sysop LIKE ' " . $subquery . " ' OR phonenumber LIKE ' " . $subquery . " ' " ;
$result = mysql_query ( $query );
$nb_posts = mysql_result ( $result , 0 );
if (( $page <= 0 ) || ( ! $page )) {
$page = 1 ; //ceil($nb_posts/$posts_per_page);
}
$query = " SELECT id,name,sysop,phonenumber FROM bbses WHERE name LIKE ' " . $subquery . " ' OR sysop LIKE ' " . $subquery . " ' OR phonenumber LIKE ' " . $subquery . " ' ORDER BY name " ;
$query .= " LIMIT " . (( $page - 1 ) * $posts_per_page ) . " , " . $posts_per_page ;
} elseif ( $type == " user " ) {
$query = " SELECT count(0) FROM users WHERE nickname LIKE ' " . $subquery . " ' " ;
$result = mysql_query ( $query );
$nb_posts = mysql_result ( $result , 0 );
if (( $page <= 0 ) || ( ! $page )) {
$page = 1 ; //ceil($nb_posts/$posts_per_page);
}
$query = " SELECT id,nickname,avatar,glops,quand FROM users WHERE nickname LIKE ' " . $subquery . " ' ORDER BY nickname " ;
$query .= " LIMIT " . (( $page - 1 ) * $posts_per_page ) . " , " . $posts_per_page ;
} elseif ( $type == 'bbs' ) {
$query = " SELECT COUNT(distinct bbs_topics.id) FROM bbs_topics LEFT JOIN bbs_posts ON bbs_topics.id=bbs_posts.topic WHERE bbs_topics.topic LIKE ' " . $subquery . " ' OR bbs_posts.post LIKE ' " . $subquery . " ' " ;
$result = mysql_query ( $query );
$nb_posts = mysql_result ( $result , 0 );
if (( $page <= 0 ) || ( ! $page )) {
$page = 1 ; //ceil($nb_posts/$posts_per_page);
}
$query = " SELECT bbs_topics.id,bbs_topics.topic,bbs_topics.lastpost,bbs_posts.post FROM bbs_topics LEFT JOIN bbs_posts ON bbs_topics.id=bbs_posts.topic WHERE bbs_topics.topic LIKE ' " . $subquery . " ' OR bbs_posts.post LIKE ' " . $subquery . " ' GROUP BY bbs_topics.id ORDER BY bbs_topics.lastpost DESC " ;
$query .= " LIMIT " . (( $page - 1 ) * $posts_per_page ) . " , " . $posts_per_page ;
}
$result = mysql_query ( $query );
$nbresults = mysql_num_rows ( $result );
while ( $tmp = mysql_fetch_array ( $result )) {
if ( $type == " user " ) {
if ( ! $tmp [ " nickname " ]) {
$tmp [ " nickname " ] = $tmp [ " login " ];
}
}
$results [] = $tmp ;
}
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
if ( $nbresults == 1 && ! $_GET [ " page " ] && ! $_GET [ " dontredirect " ]) {
switch ( $type ) {
2013-05-12 15:14:10 -04:00
case " prod " : header ( " Location: http:// $_SERVER[HTTP_HOST] /prod.php?which= " . $results [ 0 ][ 0 ]); exit (); break ;
case " group " : header ( " Location: http:// $_SERVER[HTTP_HOST] /groups.php?which= " . $results [ 0 ][ 0 ]); exit (); break ;
case " party " : header ( " Location: http:// $_SERVER[HTTP_HOST] /party.php?which= " . $results [ 0 ][ 0 ]); exit (); break ;
case " board " : header ( " Location: http:// $_SERVER[HTTP_HOST] /bbses.php?which= " . $results [ 0 ][ 0 ]); exit (); break ;
case " user " : header ( " Location: http:// $_SERVER[HTTP_HOST] /user.php?who= " . $results [ 0 ][ 0 ]); exit (); break ;
2013-05-07 14:20:08 -04:00
}
}
}
?>
< br />
< form action = " search.php " >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 0 " border = " 0 " >
< tr >
< td >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 2 " border = " 0 " width = " 100% " >
< tr >
< td bgcolor = " #224488 " >
2013-05-07 23:27:41 -04:00
< b > search on pou & euml ; t . net </ b >< br />
2013-05-07 14:20:08 -04:00
</ td >
</ tr >
< tr >
< td bgcolor = " #446688 " >
< table cellspacing = " 0 " cellpadding = " 0 " >
< tr >
< td nowrap >& nbsp ; I ' m looking for & nbsp ; </ td >
< td >< input type = " text " name = " what " size = " 20 " value = " <? print(htmlentities(stripslashes( $what ))); ?> " ></ td >
< td nowrap >& nbsp ; and this is a & nbsp ;[ </ td >
< ?
( $type == " prod " ) ? $checked1 = " checked " : $checked1 = " " ;
( $type == " group " ) ? $checked2 = " checked " : $checked2 = " " ;
( $type == " party " ) ? $checked5 = " checked " : $checked5 = " " ;
( $type == " board " ) ? $checked6 = " checked " : $checked6 = " " ;
( $type == " user " ) ? $checked3 = " checked " : $checked3 = " " ;
( $type == " bbs " ) ? $checked4 = " checked " : $checked4 = " " ;
?>
2013-05-07 23:27:27 -04:00
< td >< input id = " prod " type = " radio " name = " type " value = " prod " < ? print ( $checked1 ); ?> ></td>
< td nowrap >< label for = " prod " > prod </ label >& nbsp ; |</ td >
< td >< input id = " group " type = " radio " name = " type " value = " group " < ? print ( $checked2 ); ?> ></td>
< td nowrap >< label for = " group " > group </ label >& nbsp ; |</ td >
< td >< input id = " party " type = " radio " name = " type " value = " party " < ? print ( $checked5 ); ?> ></td>
< td nowrap >< label for = " party " > party </ label >& nbsp ; |</ td >
< td >< input id = " board " type = " radio " name = " type " value = " board " < ? print ( $checked6 ); ?> ></td>
< td nowrap >< label for = " board " > board </ label >& nbsp ; |</ td >
< td >< input id = " user " type = " radio " name = " type " value = " user " < ? print ( $checked3 ); ?> ></td>
< td nowrap >< label for = " user " > user </ label >& nbsp ; |</ td >
< td >< input id = " bbs " type = " radio " name = " type " value = " bbs " < ? print ( $checked4 ); ?> ></td>
< td nowrap >< label for = " bbs " > bbs </ label >& nbsp ;] & nbsp ; </ td >
2013-05-07 14:20:08 -04:00
</ tr >
</ table >
</ td >
</ tr >
< tr >
< td bgcolor = " #6688AA " align = " right " >
< input type = " image " src = " gfx/submit.gif " border = " 0 " >< br />
</ td >
</ tr >
</ table >
</ td >
</ tr >
</ table >
</ form >
< br />
< ? if ( $what ) {
if ( $nbresults > 0 ) :
if ( $type == " prod " ) {
for ( $i = 0 ; $i < $nbresults ; $i ++ ) {
unset ( $commentss );
// unset($checktable);
$checktable = array ();
unset ( $rulez );
unset ( $sucks );
unset ( $total );
//thumbs and avg math
$query = " SELECT comments.rating,comments.who FROM comments WHERE comments.which=' " . $results [ $i ][ " id " ] . " ' " ;
$result = mysql_query ( $query );
while ( $tmp = mysql_fetch_array ( $result )) {
$commentss [] = $tmp ;
}
for ( $ii = 0 ; $ii < count ( $commentss ); $ii ++ )
{
if ( ! array_key_exists ( $commentss [ $ii ][ " who " ], $checktable ) || $commentss [ $ii ][ " rating " ] != 0 )
$checktable [ $commentss [ $ii ][ " who " ]] = $commentss [ $ii ][ " rating " ];
}
while ( list ( $k , $v ) = each ( $checktable ))
{
if ( $v == 1 ) $rulez ++ ;
else if ( $v ==- 1 ) $sucks ++ ;
$total ++ ;
}
if ( $total )
$results [ $i ][ " avg_rating " ] = ( float )(( $rulez * 1 + $sucks *- 1 ) / $total );
$results [ $i ][ " total " ] = $total ;
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
//cdc count
$result = mysql_query ( " SELECT count(0) from users_cdcs where cdc= " . $results [ $i ][ " id " ]);
$results [ $i ][ " cdc " ] = mysql_result ( $result , 0 );
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
$result = mysql_query ( " SELECT count(0) from cdc where which= " . $results [ $i ][ " id " ]);
$results [ $i ][ " cdc " ] = $results [ $i ][ " cdc " ] + mysql_result ( $result , 0 );
if ( $results [ $i ][ " group1 " ]) :
$query = " select name,acronym from groups where id=' " . $results [ $i ][ " group1 " ] . " ' " ;
$result = mysql_query ( $query );
while ( $tmp = mysql_fetch_array ( $result )) {
$results [ $i ][ " groupn1 " ] = $tmp [ " name " ];
$results [ $i ][ " groupacron1 " ] = $tmp [ " acronym " ];
}
endif ;
if ( $results [ $i ][ " group2 " ]) :
$query = " select name,acronym from groups where id=' " . $results [ $i ][ " group2 " ] . " ' " ;
$result = mysql_query ( $query );
while ( $tmp = mysql_fetch_array ( $result )) {
$results [ $i ][ " groupn2 " ] = $tmp [ " name " ];
$results [ $i ][ " groupacron2 " ] = $tmp [ " acronym " ];
}
endif ;
if ( $results [ $i ][ " group3 " ]) :
$query = " select name,acronym from groups where id=' " . $results [ $i ][ " group3 " ] . " ' " ;
$result = mysql_query ( $query );
while ( $tmp = mysql_fetch_array ( $result )) {
$results [ $i ][ " groupn3 " ] = $tmp [ " name " ];
$results [ $i ][ " groupacron3 " ] = $tmp [ " acronym " ];
}
endif ;
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
if ( strlen ( $results [ $i ][ " groupn1 " ] . $results [ $i ][ " groupn2 " ] . $results [ $i ][ " groupn3 " ]) > 27 ) :
if ( strlen ( $results [ $i ][ " groupn1 " ]) > 10 && $results [ $i ][ " groupacron1 " ]) $results [ $i ][ " groupn1 " ] = $results [ $i ][ " groupacron1 " ];
if ( strlen ( $results [ $i ][ " groupn2 " ]) > 10 && $results [ $i ][ " groupacron2 " ]) $results [ $i ][ " groupn2 " ] = $results [ $i ][ " groupacron2 " ];
if ( strlen ( $results [ $i ][ " groupn3 " ]) > 10 && $results [ $i ][ " groupacron3 " ]) $results [ $i ][ " groupn3 " ] = $results [ $i ][ " groupacron3 " ];
endif ;
//get platforms
$query = " select platforms.name from prods_platforms, platforms where prods_platforms.prod=' " . $results [ $i ][ " id " ] . " ' and platforms.id=prods_platforms.platform " ;
$result = mysql_query ( $query );
$check = 0 ;
$results [ $i ][ " platform " ] = " " ;
while ( $tmp = mysql_fetch_array ( $result )) {
if ( $check > 0 ) $results [ $i ][ " platform " ] .= " , " ;
$check ++ ;
$results [ $i ][ " platform " ] .= $tmp [ " name " ];
}
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
//get array of sceneorgrecommendations for these results
$result = mysql_query ( " SELECT * from sceneorgrecommended where prodid= " . $results [ $i ][ " id " ] . " ORDER BY type " );
while ( $tmp = mysql_fetch_array ( $result )) {
$sceneorgrecommends [] = $tmp ;
}
}
//get max_views for popularity
$result = mysql_query ( " SELECT MAX(views) FROM prods " );
$max_views = mysql_result ( $result , 0 );
}
?>
< ? if ( $type == " prod " ) : ?>
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 0 " border = " 0 " >
< tr >
< td >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 2 " border = " 0 " >
< ? $sortlink = " prodlist.php?page= " . $page . " &order= " ; ?>
< tr bgcolor = " #224488 " >
< th >
< table >< tr >
< td >
< img src = " gfx/fleche1a.gif " width = " 13 " height = " 12 " border = " 0 " >< br />
</ td >
< td >
< b > name </ b >< br />
</ td >
</ tr ></ table >
</ th >
< th >
< b > group </ b >< br />
</ th >
< th >
< b > release party </ b >< br />
</ th >
< th >
< b > release date </ b >< br />
</ th >
< th >
< img src = " gfx/sucks.gif " alt = " rating " >
< img src = " gfx/isok.gif " alt = " rating " >
< img src = " gfx/rulez.gif " alt = " rating " >
</ th >
< th >
< b > #</b>
</ th >
< th >
< b > popularity </ b >
</ th >
</ tr >
< ?
for ( $i = 0 ; $i < $nbresults ; $i ++ ) :
echo " <!--rowstart--> \n " ;
if ( $i % 2 ) {
print ( " <tr bgcolor= \" #446688 \" > " );
} else {
print ( " <tr bgcolor= \" #557799 \" > " );
}
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
$typess = explode ( " , " , $results [ $i ][ " type " ]);
print ( " <td nowrap><table cellspacing= \" 0 \" cellpadding= \" 0 \" ><tr><td nowrap><a href= \" prod.php?which= " . $results [ $i ][ " id " ] . " \" > " );
for ( $k = 0 ; $k < count ( $typess ); $k ++ ) {
print ( " <img src= \" gfx/types/ " . $types [ $typess [ $k ]] . " \" width= \" 16 \" height= \" 16 \" border= \" 0 \" title= \" " . $typess [ $k ] . " \" > " );
}
print ( " <br /></a></td><td><img src= \" gfx/z.gif \" width= \" 2 \" height= \" 1 \" border= \" 0 \" ><br /></td><td nowrap><a href= \" prod.php?which= " . $results [ $i ][ " id " ] . " \" > " . strtolower ( stripslashes ( $results [ $i ][ " name " ])) . " </a><br /></td><td> </td> " );
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
if ( count ( $sceneorgrecommends )) :
print ( " <td nowrap> " );
for ( $k = 0 ; $k < count ( $sceneorgrecommends ); $k ++ ) {
if ( $sceneorgrecommends [ $k ][ " prodid " ] == $results [ $i ][ " id " ]) print ( " <img src= \" gfx/sceneorg/ " . $sceneorgrecommends [ $k ][ " type " ] . " .gif \" width= \" 16 \" height= \" 16 \" border= \" 0 \" title= \" " . $sceneorgrecommends [ $k ][ " category " ] . " \" alt= \" " . $sceneorgrecommends [ $k ][ " category " ] . " \" > " );
}
print ( " <br /></td> " );
endif ;
if ( $results [ $i ][ " cdc " ]) :
print ( " <td nowrap> " );
cdcstack ( $results [ $i ][ " cdc " ]);
// for($ii=0;$ii<$results[$i]["cdc"];$ii++): print("<img src=\"gfx/titles/coupdecoeur.gif\" width=\"16\" height=\"16\" border=\"0\" title=\"cdc\" alt=\"cdc\">");
// endfor;
print ( " <br /></td> " );
endif ;
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
print ( " <td width= \" 100% \" > </td> " );
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
$platforms = explode ( " , " , $results [ $i ][ " platform " ]);
for ( $kkk = 0 ; $kkk < count ( $platforms ); $kkk ++ ) {
?> <td align="right"><a href="prodlist.php?platform[]=<? print($platforms[$kkk]); ?>"><img src="gfx/os/<? print($os[$platforms[$kkk]]); ?>" width="16" height="16" border="0" title="<? print($platforms[$kkk]); ?>"></a><br /></td><?
}
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
print ( " </tr></table></td> \n " );
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
?>
< td >< a href = " groups.php?which=<? print( $results[$i] [ " group1 " ]); ?> " >< ? print ( strtolower ( $results [ $i ][ " groupn1 " ])); ?> </a>
< ? if ( $results [ $i ][ " groupn2 " ]) { print ( " :: " );} ?> <a href="groups.php?which=<? print($results[$i]["group2"]); ?>"><? print(strtolower($results[$i]["groupn2"])); ?></a>
< ? if ( $results [ $i ][ " groupn3 " ]) { print ( " :: " );} ?> <a href="groups.php?which=<? print($results[$i]["group3"]); ?>"><? print(strtolower($results[$i]["groupn3"])); ?></a>
</ td >
2013-05-07 23:27:41 -04:00
< ?
2013-05-07 14:20:08 -04:00
if (( $results [ $i ][ " partyname " ]) &&! ( $results [ $i ][ " party " ] == 1024 ))
{
if ( $results [ $i ][ " party_place " ])
{
$placeadj = " " ;
if ( $results [ $i ][ " partycompo " ] == " " ) $compophrase = " " ;
else $compophrase = " " . $results [ $i ][ " partycompo " ];
if (( $results [ $i ][ " partycompo " ] == " none " ) || ( $results [ $i ][ " partycompo " ] == " invit " )) $results [ $i ][ " party_place " ] = 98 ;
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
switch ( $results [ $i ][ " party_place " ]) {
case 1 :
case 21 :
case 31 :
case 41 :
case 51 :
case 61 :
case 71 :
case 81 :
2013-05-07 23:27:41 -04:00
case 91 : $placeadj = " st " ;
2013-05-07 14:20:08 -04:00
print ( " <td> " . $results [ $i ][ " party_place " ] . $placeadj . " at <a href= \" party.php?which= " . $results [ $i ][ " party " ] . " &when= " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " \" > " . $results [ $i ][ " partyname " ] . " " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " </a> " . $compophrase . " <br /></td> \n " );
break ;
case 2 :
case 22 :
case 32 :
case 42 :
case 52 :
case 62 :
case 72 :
case 82 :
2013-05-07 23:27:41 -04:00
case 92 : $placeadj = " nd " ;
2013-05-07 14:20:08 -04:00
print ( " <td> " . $results [ $i ][ " party_place " ] . $placeadj . " at <a href= \" party.php?which= " . $results [ $i ][ " party " ] . " &when= " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " \" > " . $results [ $i ][ " partyname " ] . " " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " </a> " . $compophrase . " <br /></td> \n " );
break ;
case 3 :
case 23 :
case 33 :
case 43 :
case 53 :
case 63 :
case 73 :
case 83 :
2013-05-07 23:27:41 -04:00
case 93 : $placeadj = " rd " ;
2013-05-07 14:20:08 -04:00
print ( " <td> " . $results [ $i ][ " party_place " ] . $placeadj . " at <a href= \" party.php?which= " . $results [ $i ][ " party " ] . " &when= " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " \" > " . $results [ $i ][ " partyname " ] . " " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " </a> " . $compophrase . " <br /></td> \n " );
break ;
case 97 : print ( " <td>disqualified at <a href= \" party.php?which= " . $results [ $i ][ " party " ] . " &when= " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " \" > " . $results [ $i ][ " partyname " ] . " " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " </a> " . $compophrase . " <br /></td> \n " );
break ;
case 98 : print ( " <td>for <a href= \" party.php?which= " . $results [ $i ][ " party " ] . " &when= " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " \" > " . $results [ $i ][ " partyname " ] . " " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " </a><br /></td> \n " );
break ;
case 99 : print ( " <td>not shown at <a href= \" party.php?which= " . $results [ $i ][ " party " ] . " &when= " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " \" > " . $results [ $i ][ " partyname " ] . " " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " </a> " . $compophrase . " <br /></td> \n " );
break ;
default : $placeadj = " th " ;
print ( " <td> " . $results [ $i ][ " party_place " ] . $placeadj . " at <a href= \" party.php?which= " . $results [ $i ][ " party " ] . " &when= " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " \" > " . $results [ $i ][ " partyname " ] . " " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " </a> " . $compophrase . " <br /></td> \n " );
break ;
}
} else
{
$placeadj = " ?? " ;
print ( " <td> " . $results [ $i ][ " party_place " ] . $placeadj . " at <a href= \" party.php?which= " . $results [ $i ][ " party " ] . " &when= " . sprintf ( " %02d " , $results [ $i ][ " party_year " ]) . " \" > " . $results [ $i ][ " partyname " ] . " </a><br /></td> \n " );
}
} else {
print ( " <td> <br /></td> \n " );
}
if ( ( $results [ $i ][ " date " ] != " 0000-00-00 " ) && ( strlen ( $results [ $i ][ " date " ]) > 0 ) )
{
$rdate = explode ( " - " , $results [ $i ][ " date " ]);
switch ( $rdate [ 1 ]) {
case " 01 " : $rmonth = " January " ; break ;
case " 02 " : $rmonth = " February " ; break ;
case " 03 " : $rmonth = " March " ; break ;
case " 04 " : $rmonth = " April " ; break ;
case " 05 " : $rmonth = " May " ; break ;
case " 06 " : $rmonth = " June " ; break ;
case " 07 " : $rmonth = " July " ; break ;
case " 08 " : $rmonth = " August " ; break ;
case " 09 " : $rmonth = " September " ; break ;
case " 10 " : $rmonth = " October " ; break ;
case " 11 " : $rmonth = " November " ; break ;
case " 12 " : $rmonth = " December " ; break ;
}
print ( " <td> " . $rmonth . " " . $rdate [ 0 ] . " <br /></td> \n " );
} else {
print ( " <td> <br /></td> \n " );
}
if ( $results [ $i ][ " avg_rating " ] > 0 )
$thumbgfx = " gfx/rulez.gif " ;
elseif ( $results [ $i ][ " avg_rating " ] == 0 )
$thumbgfx = " gfx/isok.gif " ;
else
$thumbgfx = " gfx/sucks.gif " ;
printf ( " <td> \n <table cellspacing= \" 0 \" cellpadding= \" 0 \" ><tr><td> </td><td>%.2f</td><td> </td><td><img src= \" " . $thumbgfx . " \" width= \" 16 \" height= \" 16 \" border= \" 0 \" alt= \" average rating \" align= \" left \" ></td></tr></table></td> \n " , $results [ $i ][ " avg_rating " ]);
if ( $results [ $i ][ " total " ])
{ print ( " <td> \n " . $results [ $i ][ " total " ] . " </td> \n " );
}
else
{ print ( " <td> \n 0</td> \n " );
}
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
//popularity bar
print ( " <td> \n " );
$pourcent = floor ( $results [ $i ][ " views " ] * 100 / $max_views );
//print($pourcent."%<\td>\n");
DoBar ( $pourcent );
print ( " </td> \n " );
2013-05-07 23:27:41 -04:00
?>
2013-05-07 14:20:08 -04:00
</ tr >
<!-- rowend -->
< ? endfor ; ?>
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
< ? if ((( $nb_posts - 1 ) / $posts_per_page ) > 0 ) : ?>
< tr bgcolor = " #224488 " >
< td colspan = " 9 " >
< table width = " 100% " cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >
< tr >
< ? if ( $page >= 2 ) : ?>
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< img src = " gfx/flecheg.gif " border = " 0 " >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< b > previous page </ b >< br />
</ a >
</ td >
< ? endif ; ?>
< form action = " search.php " >
< input type = " hidden " name = " what " value = " <?= $what ?> " >
< input type = " hidden " name = " type " value = " <?= $type ?> " >
< td width = " 50% " align = " right " >
< select name = " page " >
< ? for ( $i = 1 ;( $i - 1 ) <= (( $nb_posts - 1 ) / $posts_per_page ); $i ++ ) : ?>
< ? if ( $i == $page ) : ?>
< option value = " <?= $i . " \ " selected> " . $i ?> </option>
< ? else : ?>
< option value = " <?= $i . " \ " > " . $i ?> </option>
< ? endif ; ?>
< ? endfor ; ?>
</ select >
< font color = " #9FCFFF " >< b >< ? printf ( " of " . ( $i - 1 )); ?> </b></font>
& nbsp </ td >
< td width = " 50% " >
< input type = " image " src = " gfx/submit.gif " border = " 0 " >< br />
</ td >
</ form >
< ? if (( $page * $posts_per_page ) <= ( $nb_posts - 1 )) : ?>
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< b > next page </ b >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< img src = " gfx/fleched.gif " border = " 0 " >< br />
</ a >
</ td >
< ? endif ; ?>
</ tr >
</ table >
</ td >
</ tr >
< ? endif ; ?>
</ table >
</ td >
</ tr >
</ table >
< ? elseif ( $type == " group " ) : ?>
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 0 " border = " 0 " >
< tr >
< td >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 2 " border = " 0 " >
< tr bgcolor = " #224488 " >
< th >
< table >
< tr >
< td >
< img src = " gfx/fleche1a.gif " width = " 13 " height = " 12 " border = " 0 " >< br />
</ td >
< td >
< b > groups </ b >
</ td >
</ tr >
</ table >
</ th >
< th >< b > websites </ b ></ th >
< th >< b > prods </ b ></ th >
</ tr >
< ?
for ( $i = 0 ; $i < count ( $results ); $i ++ ) {
$query = " SELECT count(0) FROM prods WHERE group1= " . $results [ $i ][ " id " ] . " OR group2= " . $results [ $i ][ " id " ] . " OR group3= " . $results [ $i ][ " id " ] . " LIMIT 1 " ;
$result = mysql_query ( $query );
$nb_prods = mysql_result ( $result , 0 );
if ( $i % 2 ) {
print ( " <tr bgcolor= \" #446688 \" > \n " );
} else {
print ( " <tr bgcolor= \" #557799 \" > \n " );
}
print ( " <td valign= \" top \" ><b><a href= \" groups.php?which= " . $results [ $i ][ " id " ] . " \" > " . $results [ $i ][ " name " ]);
if ( $results [ $i ][ " acronym " ]) print ( " [ " . $results [ $i ][ " acronym " ] . " ] " );
print ( " </a></b><br /></td> \n " );
if ( $results [ $i ][ " web " ]) {
print ( " <td valign= \" top \" ><a href= \" " . $results [ $i ][ " web " ] . " \" > " . strtolower ( $results [ $i ][ " web " ]) . " </a></td> \n " );
} else {
print ( " <td><br /></td> \n " );
}
if ( $nb_prods ) {
print ( " <td valign= \" top \" > " . $nb_prods . " </td> \n " );
} else {
print ( " <td><br /></td> \n " );
}
print ( " </tr> \n " );
}
?>
< ? if ((( $nb_posts - 1 ) / $posts_per_page ) > 1 ) : ?>
< tr bgcolor = " #224488 " >
< td colspan = " 3 " >
< table width = " 100% " cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >
< tr >
< ? if ( $page >= 2 ) : ?>
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< img src = " gfx/flecheg.gif " border = " 0 " >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< b > previous page </ b >< br />
</ a >
</ td >
< ? endif ; ?>
< form action = " search.php " >
< input type = " hidden " name = " what " value = " <?= $what ?> " >
< input type = " hidden " name = " type " value = " <?= $type ?> " >
< td width = " 50% " align = " right " >
< select name = " page " >
< ? for ( $i = 1 ;( $i - 1 ) <= (( $nb_posts - 1 ) / $posts_per_page ); $i ++ ) : ?>
< ? if ( $i == $page ) : ?>
< option value = " <?= $i . " \ " selected> " . $i ?> </option>
< ? else : ?>
< option value = " <?= $i . " \ " > " . $i ?> </option>
< ? endif ; ?>
< ? endfor ; ?>
</ select >
< font color = " #9FCFFF " >< b >< ? printf ( " of " . ( $i - 1 )); ?> </b></font>
& nbsp </ td >
< td width = " 50% " >
< input type = " image " src = " gfx/submit.gif " border = " 0 " >< br />
</ td >
</ form >
< ? if (( $page * $posts_per_page ) <= ( $nb_posts - 1 )) : ?>
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< b > next page </ b >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< img src = " gfx/fleched.gif " border = " 0 " >< br />
</ a >
</ td >
< ? endif ; ?>
</ tr >
</ table >
</ td >
</ tr >
< ? endif ; ?>
</ table >
</ td >
</ tr >
</ table >
< ? elseif ( $type == " party " ) : ?>
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 0 " border = " 0 " >
< tr >
< td >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 2 " border = " 0 " >
< tr bgcolor = " #224488 " >
< th >
< table >
< tr >
< td >
< img src = " gfx/fleche1a.gif " width = " 13 " height = " 12 " border = " 0 " >< br />
</ td >
< td >
< b > party name </ b >
</ td >
</ tr >
</ table >
</ th >
< th >< b > websites </ b ></ th >
< th >< b > prods </ b ></ th >
</ tr >
< ?
for ( $i = 0 ; $i < count ( $results ); $i ++ ) {
$query = " SELECT count(0) FROM prods WHERE party= " . $results [ $i ][ " id " ] . " LIMIT 1 " ;
$result = mysql_query ( $query );
$nb_prods = mysql_result ( $result , 0 );
if ( $i % 2 ) {
print ( " <tr bgcolor= \" #446688 \" > \n " );
} else {
print ( " <tr bgcolor= \" #557799 \" > \n " );
}
print ( " <td valign= \" top \" ><a href= \" party.php?which= " . $results [ $i ][ " id " ] . " \" ><b> " . $results [ $i ][ " name " ] . " </b></a><br /></td> \n " );
if ( $results [ $i ][ " web " ]) {
print ( " <td valign= \" top \" ><a href= \" " . $results [ $i ][ " web " ] . " \" > " . strtolower ( $results [ $i ][ " web " ]) . " </a></td> \n " );
} else {
print ( " <td><br /></td> \n " );
}
if ( $nb_prods ) {
print ( " <td valign= \" top \" > " . $nb_prods . " </td> \n " );
} else {
print ( " <td><br /></td> \n " );
}
print ( " </tr> \n " );
}
?>
< ? if ((( $nb_posts - 1 ) / $posts_per_page ) > 1 ) : ?>
< tr bgcolor = " #224488 " >
< td colspan = " 3 " >
< table width = " 100% " cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >
< tr >
< ? if ( $page >= 2 ) : ?>
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< img src = " gfx/flecheg.gif " border = " 0 " >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< b > previous page </ b >< br />
</ a >
</ td >
< ? endif ; ?>
< form action = " search.php " >
< input type = " hidden " name = " what " value = " <?= $what ?> " >
< input type = " hidden " name = " type " value = " <?= $type ?> " >
< td width = " 50% " align = " right " >
< select name = " page " >
< ? for ( $i = 1 ;( $i - 1 ) <= (( $nb_posts - 1 ) / $posts_per_page ); $i ++ ) : ?>
< ? if ( $i == $page ) : ?>
< option value = " <?= $i . " \ " selected> " . $i ?> </option>
< ? else : ?>
< option value = " <?= $i . " \ " > " . $i ?> </option>
< ? endif ; ?>
< ? endfor ; ?>
</ select >
< font color = " #9FCFFF " >< b >< ? printf ( " of " . ( $i - 1 )); ?> </b></font>
& nbsp </ td >
< td width = " 50% " >
< input type = " image " src = " gfx/submit.gif " border = " 0 " >< br />
</ td >
</ form >
< ? if (( $page * $posts_per_page ) <= ( $nb_posts - 1 )) : ?>
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< b > next page </ b >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< img src = " gfx/fleched.gif " border = " 0 " >< br />
</ a >
</ td >
< ? endif ; ?>
</ tr >
</ table >
</ td >
</ tr >
< ? endif ; ?>
</ table >
</ td >
</ tr >
</ table >
< ? elseif ( $type == " party " ) : ?>
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 0 " border = " 0 " >
< tr >
< td >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 2 " border = " 0 " >
< tr bgcolor = " #224488 " >
< th >
< table >
< tr >
< td >
< img src = " gfx/fleche1a.gif " width = " 13 " height = " 12 " border = " 0 " >< br />
</ td >
< td >
< b > party name </ b >
</ td >
</ tr >
</ table >
</ th >
< th >< b > websites </ b ></ th >
< th >< b > prods </ b ></ th >
</ tr >
< ?
for ( $i = 0 ; $i < count ( $results ); $i ++ ) {
$query = " SELECT count(0) FROM prods WHERE party= " . $results [ $i ][ " id " ] . " LIMIT 1 " ;
$result = mysql_query ( $query );
$nb_prods = mysql_result ( $result , 0 );
if ( $i % 2 ) {
print ( " <tr bgcolor= \" #446688 \" > \n " );
} else {
print ( " <tr bgcolor= \" #557799 \" > \n " );
}
print ( " <td valign= \" top \" ><a href= \" party.php?which= " . $results [ $i ][ " id " ] . " \" ><b> " . $results [ $i ][ " name " ] . " </b></a><br /></td> \n " );
if ( $results [ $i ][ " web " ]) {
print ( " <td valign= \" top \" ><a href= \" " . $results [ $i ][ " web " ] . " \" > " . strtolower ( $results [ $i ][ " web " ]) . " </a></td> \n " );
} else {
print ( " <td><br /></td> \n " );
}
if ( $nb_prods ) {
print ( " <td valign= \" top \" > " . $nb_prods . " </td> \n " );
} else {
print ( " <td><br /></td> \n " );
}
print ( " </tr> \n " );
}
?>
< ? if ((( $nb_posts - 1 ) / $posts_per_page ) > 1 ) : ?>
< tr bgcolor = " #224488 " >
< td colspan = " 3 " >
< table width = " 100% " cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >
< tr >
< ? if ( $page >= 2 ) : ?>
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< img src = " gfx/flecheg.gif " border = " 0 " >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< b > previous page </ b >< br />
</ a >
</ td >
< ? endif ; ?>
< form action = " search.php " >
< input type = " hidden " name = " what " value = " <?= $what ?> " >
< input type = " hidden " name = " type " value = " <?= $type ?> " >
< td width = " 50% " align = " right " >
< select name = " page " >
< ? for ( $i = 1 ;( $i - 1 ) <= (( $nb_posts - 1 ) / $posts_per_page ); $i ++ ) : ?>
< ? if ( $i == $page ) : ?>
< option value = " <?= $i . " \ " selected> " . $i ?> </option>
< ? else : ?>
< option value = " <?= $i . " \ " > " . $i ?> </option>
< ? endif ; ?>
< ? endfor ; ?>
</ select >
< font color = " #9FCFFF " >< b >< ? printf ( " of " . ( $i - 1 )); ?> </b></font>
& nbsp </ td >
< td width = " 50% " >
< input type = " image " src = " gfx/submit.gif " border = " 0 " >< br />
</ td >
</ form >
< ? if (( $page * $posts_per_page ) <= ( $nb_posts - 1 )) : ?>
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< b > next page </ b >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< img src = " gfx/fleched.gif " border = " 0 " >< br />
</ a >
</ td >
< ? endif ; ?>
</ tr >
</ table >
</ td >
</ tr >
< ? endif ; ?>
</ table >
</ td >
</ tr >
</ table >
< ? elseif ( $type == " board " ) : ?>
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 0 " border = " 0 " >
< tr >
< td >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 2 " border = " 0 " >
< tr bgcolor = " #224488 " >
< th >
< table >
< tr >
< td >
< img src = " gfx/fleche1a.gif " width = " 13 " height = " 12 " border = " 0 " >< br />
</ td >
< td >
< b > board name </ b >
</ td >
</ tr >
</ table >
</ th >
< th >< b > sysop </ b ></ th >
< th >< b > number </ b ></ th >
</ tr >
< ?
for ( $i = 0 ; $i < count ( $results ); $i ++ ) {
if ( $i % 2 ) {
print ( " <tr bgcolor= \" #446688 \" > \n " );
} else {
print ( " <tr bgcolor= \" #557799 \" > \n " );
}
print ( " <td valign= \" top \" ><a href= \" bbses.php?which= " . $results [ $i ][ " id " ] . " \" ><b> " . $results [ $i ][ " name " ] . " </b></a><br /></td> \n " );
if ( $results [ $i ][ " sysop " ]) {
print ( " <td valign= \" top \" ><a href= \" " . $results [ $i ][ " sysop " ] . " \" > " . strtolower ( $results [ $i ][ " sysop " ]) . " </a></td> \n " );
} else {
print ( " <td><br /></td> \n " );
}
if ( $results [ $i ][ " phonenumber " ]) {
print ( " <td valign= \" top \" ><a href= \" " . $results [ $i ][ " phonenumber " ] . " \" > " . strtolower ( $results [ $i ][ " phonenumber " ]) . " </a></td> \n " );
} else {
print ( " <td><br /></td> \n " );
}
print ( " </tr> \n " );
}
?>
< ? if ((( $nb_posts - 1 ) / $posts_per_page ) > 1 ) : ?>
< tr bgcolor = " #224488 " >
< td colspan = " 3 " >
< table width = " 100% " cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >
< tr >
< ? if ( $page >= 2 ) : ?>
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< img src = " gfx/flecheg.gif " border = " 0 " >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< b > previous page </ b >< br />
</ a >
</ td >
< ? endif ; ?>
< form action = " search.php " >
< input type = " hidden " name = " what " value = " <?= $what ?> " >
< input type = " hidden " name = " type " value = " <?= $type ?> " >
< td width = " 50% " align = " right " >
< select name = " page " >
< ? for ( $i = 1 ;( $i - 1 ) <= (( $nb_posts - 1 ) / $posts_per_page ); $i ++ ) : ?>
< ? if ( $i == $page ) : ?>
< option value = " <?= $i . " \ " selected> " . $i ?> </option>
< ? else : ?>
< option value = " <?= $i . " \ " > " . $i ?> </option>
< ? endif ; ?>
< ? endfor ; ?>
</ select >
< font color = " #9FCFFF " >< b >< ? printf ( " of " . ( $i - 1 )); ?> </b></font>
& nbsp </ td >
< td width = " 50% " >
< input type = " image " src = " gfx/submit.gif " border = " 0 " >< br />
</ td >
</ form >
< ? if (( $page * $posts_per_page ) <= ( $nb_posts - 1 )) : ?>
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< b > next page </ b >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< img src = " gfx/fleched.gif " border = " 0 " >< br />
</ a >
</ td >
< ? endif ; ?>
</ tr >
</ table >
</ td >
</ tr >
< ? endif ; ?>
</ table >
</ td >
</ tr >
</ table >
< ? elseif ( $type == " user " ) : ?>
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 0 " border = " 0 " >
< tr >
< td >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 2 " border = " 0 " >
< tr bgcolor = " #224488 " >
< th >
< table >
< tr >
< td >
< img src = " gfx/fleche1a.gif " width = " 13 " height = " 12 " border = " 0 " >< br />
</ td >
< td >
< b > nickname </ b >
</ td >
</ tr >
</ table >
</ th >
< th >
< b > glops </ b >
</ th >
< th >
< b > registered </ b >
</ th >
</ tr >
< ? for ( $i = 0 ; $i < count ( $results ); $i ++ ) : ?>
< ? if ( $i % 2 ) : ?>
< tr bgcolor = " #446688 " >
< ? else : ?>
< tr bgcolor = " #557799 " >
< ? endif ; ?>
< td valign = " top " >
< table cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >< tr >
< td >< a href = " user.php?who=<? print( $results[$i] [ " id " ]); ?> " >< img src = " avatars/<? print( $results[$i] [ " avatar " ]); ?> " width = " 16 " height = " 16 " border = " 0 " alt = " <? print( $results[$i] [ " nickname " ]); ?> " ></ a >< br /></ td >
< td >& nbsp ; </ td >
< td >< a href = " user.php?who=<? print( $results[$i] [ " id " ]); ?> " >< b >< ? print ( $results [ $i ][ " nickname " ]); ?> </b></a><br /></td>
</ tr ></ table >
</ td >
< td >< ? print ( $results [ $i ][ " glops " ]); ?> <br /></td>
< td >< ? print ( $results [ $i ][ " quand " ]); ?> <br /></td>
</ tr >
< ? endfor ; ?>
< ? if ((( $nb_posts - 1 ) / $posts_per_page ) > 1 ) : ?>
< tr bgcolor = " #224488 " >
< td colspan = " 3 " >
< table width = " 100% " cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >
< tr >
< ? if ( $page >= 2 ) : ?>
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< img src = " gfx/flecheg.gif " border = " 0 " >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< b > previous page </ b >< br />
</ a >
</ td >
< ? endif ; ?>
< form action = " search.php " >
< input type = " hidden " name = " what " value = " <?= $what ?> " >
< input type = " hidden " name = " type " value = " <?= $type ?> " >
< td width = " 50% " align = " right " >
< select name = " page " >
< ? for ( $i = 1 ;( $i - 1 ) <= (( $nb_posts - 1 ) / $posts_per_page ); $i ++ ) : ?>
< ? if ( $i == $page ) : ?>
< option value = " <?= $i . " \ " selected> " . $i ?> </option>
< ? else : ?>
< option value = " <?= $i . " \ " > " . $i ?> </option> <? endif; ?>
< ? endfor ; ?>
</ select >
< font color = " #9FCFFF " >< b >< ? printf ( " of " . ( $i - 1 )); ?> </b></font>
& nbsp </ td >
< td width = " 50% " >
< input type = " image " src = " gfx/submit.gif " border = " 0 " >< br />
</ td >
</ form >
< ? if (( $page * $posts_per_page ) <= ( $nb_posts - 1 )) : ?>
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< b > next page </ b >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< img src = " gfx/fleched.gif " border = " 0 " >< br />
</ a >
</ td >
< ? endif ; ?>
</ tr >
</ table >
</ td >
</ tr >
< ? endif ; ?>
</ table >
</ td >
</ tr >
</ table >
< ? elseif ( $type == " bbs " ) : ?>
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 0 " border = " 0 " width = " 600 " >
< tr >
< td >
< table bgcolor = " #000000 " cellspacing = " 1 " cellpadding = " 2 " border = " 0 " >
< tr bgcolor = " #224488 " >
< th >
< table >
< tr >
< td >
< img src = " gfx/fleche1a.gif " width = " 13 " height = " 12 " border = " 0 " >< br />
</ td >
< td >
< b > topic </ b >
</ td >
</ tr >
</ table >
</ th >
< th > last post </ th >
</ tr >
< ?
for ( $i = 0 ; $i < count ( $results ); $i ++ ) :
$a = explode ( " " , $what );
2013-05-07 23:27:41 -04:00
2013-05-07 14:20:08 -04:00
?>
< tr bgcolor = " #446688 " >
< td valign = " top " >
< a href = " topic.php?which=<?= $results[$i] [ " id " ]?> " >< ?
$s = htmlcleanonerow ( $results [ $i ][ " topic " ]);
/*
foreach ( $a as $v ) {
$p = preg_replace ( " /( " . addcslashes ( $v , " /* " ) . " )/i " , " <span style='background:yellow;color:black;'> \$ 1</span> " , $p );
//$p = str_replace($v,"<span style='background:yellow;color:black;'>".$v."</span>",$p);
}
*/
$s = preg_replace ( " /( \ s+)/ " , " " , $s );
$s = htmlspecialchars ( mb_strcut ( $s , max ( 0 , stripos ( $s , $a [ 0 ]) - 50 ), 100 , " utf-8 " ));
foreach ( $a as $v2 ) {
$s = preg_replace ( " /( " . $v2 . " )/i " , " <span class='searchhighlight'> $ 1</span> " , $s );
2013-05-07 23:27:41 -04:00
}
2013-05-07 14:20:08 -04:00
echo $s ;
?> </a>
</ td >
< td valign = " top " >
< ? = $results [ $i ][ " lastpost " ] ?>
</ td >
</ tr >
< tr bgcolor = " #557799 " >
< td valign = " top " colspan = " 2 " >
< ?
$a = explode ( " " , $what );
//$s = strip_tags(parse_message($results[$i]["post"]));
$s = strip_tags ( parse_message ( $results [ $i ][ " post " ]));
$s = preg_replace ( " /( \ s+)/ " , " " , $s );
$s = htmlspecialchars ( mb_strcut ( $s , max ( 0 , stripos ( $s , $a [ 0 ]) - 50 ), 100 , " utf-8 " ));
foreach ( $a as $v2 ) {
$s = preg_replace ( " /( " . $v2 . " )/i " , " <span class='searchhighlight'> $ 1</span> " , $s );
2013-05-07 23:27:41 -04:00
}
2013-05-07 14:20:08 -04:00
// foreach($a as $v)
// $p = preg_replace("/(".addcslashes($v,"/*").")/i","<span style='background:yellow;color:black;'>\$1</span>",$p);
// $p = str_replace($v,"<span style='background:yellow;color:black;'>".$v."</span>",$p);
2013-05-07 23:27:41 -04:00
echo " ... " . $s . " ... " ;
?>
2013-05-07 14:20:08 -04:00
</ td >
</ tr >
< ? endfor ; ?>
< ? if ((( $nb_posts - 1 ) / $posts_per_page ) > 1 ) : ?>
< tr bgcolor = " #224488 " >
< td colspan = " 2 " >
< table width = " 100% " cellspacing = " 0 " cellpadding = " 0 " border = " 0 " >
< tr >
< ? if ( $page >= 2 ) : ?>
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< img src = " gfx/flecheg.gif " border = " 0 " >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page -1)?> " >
< b > previous page </ b >< br />
</ a >
</ td >
< ? endif ; ?>
< form action = " search.php " >
< input type = " hidden " name = " what " value = " <?= $what ?> " >
< input type = " hidden " name = " type " value = " <?= $type ?> " >
< td width = " 50% " align = " right " >
< select name = " page " >
< ? for ( $i = 1 ;( $i - 1 ) <= (( $nb_posts - 1 ) / $posts_per_page ); $i ++ ) : ?>
< ? if ( $i == $page ) : ?>
< option value = " <?= $i . " \ " selected> " . $i ?> </option>
< ? else : ?>
< option value = " <?= $i . " \ " > " . $i ?> </option>
< ? endif ; ?>
< ? endfor ; ?>
</ select >
< font color = " #9FCFFF " >< b >< ? printf ( " of " . ( $i - 1 )); ?> </b></font>
& nbsp </ td >
< td width = " 50% " >
< input type = " image " src = " gfx/submit.gif " border = " 0 " >< br />
</ td >
</ form >
< ? if (( $page * $posts_per_page ) <= ( $nb_posts - 1 )) : ?>
< td nowrap >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< b > next page </ b >< br />
</ a >
</ td >
< td >& nbsp ; </ td >
< td >
< a href = " search.php?what=<?= $what ?>&type=<?= $type ?>&page=<?=( $page +1)?> " >
< img src = " gfx/fleched.gif " border = " 0 " >< br />
</ a >
</ td >
< ? endif ; ?>
</ tr >
</ table >
</ td >
</ tr >
< ? endif ; ?>
</ table >
</ td >
</ tr >
</ table >
< ? endif ; ?>
< br />
2013-05-07 23:27:41 -04:00
< ? else : print ( " no results again! life sux! :?(<br /><br /> " ); endif ; ?>
2013-05-07 14:20:08 -04:00
< ?
}
require ( " include/bottom.php " ); ?>