2004-08-29 20:55:50 +00:00
< ? php
// ***** BEGIN LICENSE BLOCK *****
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
//
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
//
// The Original Code is Mozilla Update.
//
// The Initial Developer of the Original Code is
// Chris "Wolf" Crews.
// Portions created by the Initial Developer are Copyright (C) 2004
// the Initial Developer. All Rights Reserved.
//
// Contributor(s):
// Chris "Wolf" Crews <psychoticwolf@carolina.rr.com>
//
// Alternatively, the contents of this file may be used under the terms of
// either the GNU General Public License Version 2 or later (the "GPL"), or
// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
// in which case the provisions of the GPL or the LGPL are applicable instead
// of those above. If you wish to allow use of your version of this file only
// under the terms of either the GPL or the LGPL, and not to allow others to
// use your version of this file under the terms of the MPL, indicate your
// decision by deleting the provisions above and replace them with the notice
// and other provisions required by the GPL or the LGPL. If you do not delete
// the provisions above, a recipient may use your version of this file under
// the terms of any one of the MPL, the GPL or the LGPL.
//
// ***** END LICENSE BLOCK *****
2005-01-23 20:04:28 +00:00
2004-08-29 20:55:50 +00:00
require " ../core/config.php " ;
?>
2004-12-09 06:34:53 +00:00
<! DOCTYPE HTML PUBLIC " -//W3C//DTD HTML 4.01//EN " " http://www.w3.org/TR/html4/strict.dtd " >
< html lang = " en " >
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
< head >
2004-08-29 20:55:50 +00:00
< ? php
//Bookmarking-Friendly Page Title
2004-12-09 06:34:53 +00:00
$id = escape_string ( $_GET [ " id " ]);
$sql = " SELECT Name FROM `main` WHERE ID = ' $id ' AND Type = 'T' LIMIT 1 " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
if ( mysql_num_rows ( $sql_result ) === 0 ) {
$return = page_error ( " 1 " , " Theme ID is Invalid or Missing. " );
exit ;
}
$row = mysql_fetch_array ( $sql_result );
2004-08-29 20:55:50 +00:00
//Page Titles
2004-12-09 06:34:53 +00:00
$pagetitles = array ( " releases " => " All Releases " , " previews " => " Preview Images " , " comments " => " User Comments " , " staffreview " => " Editor Review " , " opinion " => " My Opinion " );
$pagetitle = $pagetitles [ $_GET [ " page " ]];
2004-08-29 20:55:50 +00:00
?>
2004-12-09 06:34:53 +00:00
< title > Mozilla Update :: Themes -- More Info : < ? php echo " $row[Name] " ; if ( $pagetitle ) { echo " - $pagetitle " ; } ?> </title>
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
< ? php
installtrigger ( " themes " );
include " $page_header " ;
?>
2004-10-07 06:36:17 +00:00
2004-12-09 06:34:53 +00:00
< div id = " mBody " >
2004-11-30 22:54:24 +00:00
2004-12-09 06:34:53 +00:00
< ? php
2004-08-29 20:55:50 +00:00
$type = " T " ;
2004-12-09 06:34:53 +00:00
$index = yes ;
2004-08-29 20:55:50 +00:00
$category = $_GET [ " category " ];
include " inc_sidebar.php " ;
2004-10-07 06:36:17 +00:00
2004-12-09 06:34:53 +00:00
$id = escape_string ( $_GET [ " id " ]);
2004-11-24 08:24:07 +00:00
2004-08-29 20:55:50 +00:00
//Get Author Data
2005-01-23 20:04:28 +00:00
$sql2 = " SELECT TM.Name, TU.UserName, TU.UserID, TU.UserEmail
FROM `main` TM
2004-12-09 06:34:53 +00:00
LEFT JOIN authorxref TAX ON TM . ID = TAX . ID
INNER JOIN userprofiles TU ON TAX . UserID = TU . UserID
WHERE TM . ID = '$id'
ORDER BY `Type` , `Name` ASC " ;
2005-01-23 20:04:28 +00:00
2004-12-09 06:34:53 +00:00
$sql_result2 = mysql_query ( $sql2 , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
while ( $row2 = mysql_fetch_array ( $sql_result2 )) {
$authorarray [ $row2 [ Name ]][] = $row2 [ " UserName " ];
$authorids [ $row2 [ UserName ]] = $row2 [ " UserID " ];
2004-08-29 20:55:50 +00:00
}
2004-10-07 06:36:17 +00:00
//Assemble a display application version array
2004-12-09 06:34:53 +00:00
$sql = " SELECT `Version`, `major`, `minor`, `release`, `SubVer` FROM `applications` WHERE `AppName`=' $application ' ORDER BY `major`,`minor` " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
2005-01-23 20:04:28 +00:00
while ( $row = mysql_fetch_array ( $sql_result )) {
$version = $row [ " Version " ];
$subver = $row [ " SubVer " ];
$release = " $row[major] . $row[minor] " ;
if ( $row [ " release " ]) {
$release = " . $release $row[release] " ;
}
if ( $subver !== " final " ) {
$release = " $release $subver " ;
}
$appvernames [ $release ] = $version ;
}
2004-08-29 20:55:50 +00:00
//Run Query and Create List
$s = " 0 " ;
2004-10-07 06:36:17 +00:00
$sql = " SELECT TM.ID, TM.Name, TM.DateAdded, TM.DateUpdated, TM.Homepage, TM.Description, TM.Rating, TM.TotalDownloads, TM.downloadcount, TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.DateAdded AS VerDateAdded, TV.DateUpdated AS VerDateUpdated, TV.URI, TV.Notes, TA.AppName, TOS.OSName
2005-01-23 20:04:28 +00:00
FROM `main` TM
INNER JOIN version TV ON TM . ID = TV . ID
INNER JOIN applications TA ON TV . AppID = TA . AppID
INNER JOIN os TOS ON TV . OSID = TOS . OSID " ;
2004-08-29 20:55:50 +00:00
2005-01-23 20:04:28 +00:00
// If special category, we don't want to join on the category table
if ( $category == " Editors Pick "
or $category == " Newest "
or $category == " Popular "
or $category == " Top Rated " ) {
unset ( $category );
}
2004-08-29 20:55:50 +00:00
2005-01-23 20:04:28 +00:00
if ( $category ) {
$sql .= " INNER JOIN categoryxref TCX ON TM.ID = TCX.ID
INNER JOIN categories TC ON TCX . CategoryID = TC . CategoryID " ;
}
2004-11-24 08:24:07 +00:00
2005-01-23 20:04:28 +00:00
if ( $editorpick == " true " ) {
$sql .= " INNER JOIN reviews TR ON TM.ID = TR.ID " ;
}
2004-08-29 20:55:50 +00:00
2005-01-23 20:04:28 +00:00
$sql .= " WHERE TM.ID = ' $id ' " ;
2004-08-29 20:55:50 +00:00
2005-01-23 20:04:28 +00:00
if ( $_GET [ " vid " ]) {
$vid = $_GET [ " vid " ];
$sql .= " AND TV.vID = ' $vid ' AND `approved` = 'YES' " ;
2004-12-09 06:34:53 +00:00
2005-01-23 20:04:28 +00:00
} else {
2004-08-29 20:55:50 +00:00
2005-01-23 20:04:28 +00:00
$sql .= " AND Type = ' $type '
AND AppName = '$application'
AND `approved` = 'YES' " ;
2004-10-07 06:36:17 +00:00
2005-01-23 20:04:28 +00:00
if ( $editorpick == " true " ) {
$sql .= " AND TR.Pick = 'YES' " ;
}
2004-10-07 06:36:17 +00:00
2005-01-23 20:04:28 +00:00
if ( $category ) {
$sql .= " AND CatName LIKE ' $category ' " ;
}
2004-08-29 20:55:50 +00:00
2005-01-23 20:04:28 +00:00
if ( $app_version ) {
$sql .= " AND TV.MinAppVer_int <= ' " . strtolower ( $app_version ) . " ' AND TV.MaxAppVer_int >= ' " . strtolower ( $app_version ) . " ' " ;
}
2004-10-07 06:36:17 +00:00
2005-01-23 20:04:28 +00:00
if ( $OS ) {
$sql .= " AND (TOS.OSName = ' $OS ' OR TOS.OSName = 'All') " ;
}
2004-12-09 06:34:53 +00:00
}
2005-01-23 20:04:28 +00:00
$sql .= " ORDER BY `Name` , `Version` DESC LIMIT 1 " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
$row = mysql_fetch_array ( $sql_result );
$v ++ ;
$vid = $row [ " vID " ];
$name = $row [ " Name " ];
$dateadded = $row [ " DateAdded " ];
$dateupdated = $row [ " DateUpdated " ];
$homepage = $row [ " Homepage " ];
$description = $row [ " Description " ];
$rating = $row [ " Rating " ];
$authors = $authorarray [ $name ];
$appname = $row [ " AppName " ];
$osname = $row [ " OSName " ];
$verdateadded = $row [ " VerDateAdded " ];
$verdateupdated = $row [ " VerDateUpdated " ];
$filesize = $row [ " Size " ];
$notes = $row [ " Notes " ];
$version = $row [ " Version " ];
$uri = $row [ " URI " ];
$downloadcount = $row [ " TotalDownloads " ];
$populardownloads = $row [ " downloadcount " ];
if ( ! $_GET [ 'vid' ]) {
$_GET [ 'vid' ] = $vid ;
}
if ( $appvernames [ $row [ " MinAppVer " ]]) {
$minappver = $appvernames [ $row [ " MinAppVer " ]];
} else {
$minappver = $row [ " MinAppVer " ];
}
if ( $appvernames [ $row [ " MaxAppVer " ]]) {
$maxappver = $appvernames [ $row [ " MaxAppVer " ]];
} else {
$maxappver = $row [ " MaxAppVer " ];
}
if ( $verdateadded > $dateadded ) {
$dateadded = $verdateadded ;
}
if ( $verdateupdated > $dateupdated ) {
$dateupdated = $verdateupdated ;
}
//Turn Authors Array into readable string...
$authorcount = count ( $authors );
if ( ! $authors ) {
$authors = array ();
}
foreach ( $authors as $author ) {
$userid = $authorids [ $author ];
$n ++ ;
$authorstring .= " <A HREF= \" authorprofiles.php? " . uriparams () . " &id= $userid\ " > $author </ A > " ;
if ( $authorcount != $n ) {
$authorstring .= " , " ;
2004-12-09 06:34:53 +00:00
}
2005-01-23 20:04:28 +00:00
}
2004-08-29 20:55:50 +00:00
2005-01-23 20:04:28 +00:00
$authors = $authorstring ;
unset ( $authorstring , $n ); // Clear used Vars..
2004-11-28 17:29:04 +00:00
2005-01-23 20:04:28 +00:00
// Create Date String
if ( $dateupdated > $dateadded ) {
$timestamp = $dateupdated ;
$datetitle = " Last Updated: " ;
} else {
$timestamp = $dateadded ;
$datetitle = " Released On: " ;
}
$date = date ( " F d, Y g:i:sa " , strtotime ( " $timestamp " ));
$releasedate = date ( " F d, Y " , strtotime ( " $dateadded " ));
$datestring = " $datetitle $date " ;
//Rating
if ( ! $rating ) {
$rating = " 0 " ;
}
//No Results Returned for Main Query, throw the Incompatible Error.
if ( mysql_num_rows ( $sql_result ) == " 0 " ) {
echo " <div id= \" mainContent \" > \n " ;
echo " <h1>Incompatible Theme or Theme No Longer Available</h1> \n " ;
echo " The theme you requested is either incompatible with the application selected, or the version of it is no longer available on Mozilla Update.<br><br> \n " ;
echo " To try your request again for a different application version, use the form below.<br> \n " ;
echo " <form name= \" changeapp \" method= \" get \" action= \" ? \" >
< input name = \ " id \" type= \" hidden \" value= \" $id\ " >
< input name = \ " os \" type= \" hidden \" value= \" $OS\ " >
< strong > " .ucwords( $application ). " </ strong > < input name = \ " application \" type= \" hidden \" value= \" $application\ " > " ;
echo " <select name= \" version \" > " ;
$sql = " SELECT `Version`,`major`,`minor`,`release`,`SubVer`
FROM `applications`
WHERE `AppName` = '$application' and `public_ver` = 'YES'
ORDER BY `major` DESC , `minor` DESC , `release` DESC , `SubVer` DESC " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
while ( $row = mysql_fetch_array ( $sql_result )) {
$release = " $row[major] . $row[minor] " ;
if ( $row [ " release " ]) {
$release .= " . $row[release] " ;
}
$subver = $row [ " SubVer " ];
if ( $subver !== " final " ) {
$release .= " $subver " ;
}
2004-12-09 06:34:53 +00:00
2005-01-23 20:04:28 +00:00
echo " <option value= \" $release\ " > $row [ Version ] </ option > " ;
2004-12-09 06:34:53 +00:00
2004-11-28 17:29:04 +00:00
}
2005-01-23 20:04:28 +00:00
echo " </select> <input name= \" go \" type= \" submit \" value= \" Go \" > " ;
echo " </form> " ;
echo " </div> \n </div> \n " ;
include " $page_footer " ;
echo " </body> \n </html> \n " ;
exit ;
}
2004-11-28 17:29:04 +00:00
2004-12-09 06:34:53 +00:00
//Get Preview Image URI
$sql3 = " SELECT `PreviewURI`, `caption` from `previews` WHERE `ID` = ' $id ' AND `preview`='YES' LIMIT 1 " ;
$sql_result3 = mysql_query ( $sql3 , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
$row3 = mysql_fetch_array ( $sql_result3 );
$previewuri = $row3 [ " PreviewURI " ];
$caption = $row3 [ " caption " ];
2004-10-07 06:36:17 +00:00
?>
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
< div id = " mainContent " >
2004-12-20 13:38:30 +00:00
< ? php
if ( $rating != NULL ) {
?>
< div class = " rating " title = " <?php echo " $rating " ; ?> Stars out of 5 " > Rating : < ? php
for ( $i = 1 ; $i <= floor ( $rating ); $i ++ ) {
echo " <IMG SRC= \" /images/stars/star_icon.png \" width= \" 17 \" height= \" 20 \" ALT= \" " ; if ( $i == 1 ) { echo " $rating stars out of 5 " ;} echo " \" > " ;
}
if ( $rating > floor ( $rating )) {
$val = ( $rating - floor ( $rating )) * 10 ;
echo " <IMG SRC= \" /images/stars/star_0 $val .png \" width= \" 17 \" height= \" 20 \" ALT= \" \" > " ;
$i ++ ;
}
for ( $i = $i ; $i <= 5 ; $i ++ ) {
echo " <IMG SRC= \" /images/stars/graystar_icon.png \" width= \" 17 \" height= \" 20 \" ALT= \" " ; if ( $i == 1 ) { echo " $rating stars out of 5 " ;} echo " \" > " ;
}
?>
</ div >
< ? php } ?>
2004-12-09 06:34:53 +00:00
< h2 class = " first " >< strong >< ? php echo " $name " ; ?> </strong> - <?php echo ucwords("$application")." Theme"; ?></h2>
2004-12-22 11:46:55 +00:00
< p class = " first " >< a href = " ?<?php echo uriparams(). " & amp ; id = $id " ; ?> " >< ? php echo " $name $version " ; ?> </a>, by <?php echo"$authors"; ?>, released on <?php echo"$releasedate"; ?></p>
2004-12-09 06:34:53 +00:00
< ? php
//Begin Pages
$page = $_GET [ " page " ];
if ( ! $page or $page == " general " ) {
//General Page / Default
?>
< ? php
if ( $previewuri ) {
?>
< p class = " screenshot " >
< ? php
$sql = " SELECT `PreviewID` from `previews` WHERE `ID`=' $id ' and `preview`='NO' LIMIT 1 " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
if ( mysql_num_rows ( $sql_result ) > " 0 " ) {
?>
< A HREF = " ?<?php echo " " .uriparams(). " & amp ; id = $id & amp ; page = previews " ; ?> " >
< ? php } ?>
< ? php
list ( $width , $height , $attr ) = getimagesize ( " $websitepath " . " $previewuri " );
echo " <img src= \" $previewuri\ " height = $height width = $width alt = \ " $name preview - $caption\ " title = \ " $caption\ " > \n " ;
?>
< ? php if ( mysql_num_rows ( $sql_result ) > " 0 " ) { ?>
</ a >
2004-12-23 22:58:15 +00:00
< strong >< a href = " ?<?php echo " " .uriparams(). " & amp ; id = $id & amp ; page = previews " ; ?> " > More Previews & #187;</a></strong>
2004-12-09 06:34:53 +00:00
< ? php } ?>
</ p >
< ? php
}
?>
< h3 > Quick Description </ h3 >
< p class = " first " >
< ? php
echo " $description " ;
if ( $notes ) {
echo " <br><br> $notes\n " ;
}
?>
</ p >
< p class = " requires " > Requires : < ? php echo ucwords ( $appname ) . " : $minappver - $maxappver " ; ?> <img src="/images/<?php echo strtolower($appname); ?>_icon.png" width="34" height="34" alt="<?php echo ucwords($appname); ?>">
< ? php
if ( $osname !== " ALL " ) {
echo " on " . ucwords ( $osname ) . " <IMG SRC= \" /images/ " . strtolower ( $osname ) . " _icon.png \" BORDER=0 HEIGHT=34 WIDTH=34 ALT= \" <?php echo ucwords( $osname ); ?> \" > " ;
}
?>
</ p >
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
< div class = " key-point install-box " >< div class = " install " >< ? php
if ( $appname == " Thunderbird " ) {
2005-01-23 19:20:06 +00:00
$downloadURL = mozupd_buildDownloadURL ( $uri , $name , $version );
echo " <a href= \" $downloadURL\ " onclick = \ " return installTheme(event,' $name $version for Thunderbird'); \" title= \" Right-Click to Download $name $version\ " > " ;
2004-12-09 06:34:53 +00:00
} else {
2004-12-24 08:13:41 +00:00
echo " <b><a href= \" $uri\ " onclick = \ " return installTheme(event,' $name $version '); \" TITLE= \" Install $name $version (Right-Click to Download) \" > " ;
2004-12-09 06:34:53 +00:00
}
2004-12-24 08:13:41 +00:00
?> Install Now</a></b> (<?php echo"$filesize"; ?> KB File)</div></div>
2004-12-09 06:34:53 +00:00
< ? php
//Special Theme Installation Instructions for Thunderbird users
if ( $application == " thunderbird " ) {
echo " <SPAN style= \" font-size: 10pt; color: #00F \" >Theme Install Instructions for Thunderbird Users:</SPAN><BR>
< SPAN style = \ " font-size: 8pt; \" >(1) Right-Click the link above and choose \" Save Link As... \" to Download and save the file to your hard disk.<BR>
( 2 ) In Mozilla Thunderbird , open the theme manager ( Tools Menu / Themes ) < BR >
( 3 ) Click the Install button , and locate / select the file you downloaded and click \ " OK \" </SPAN><BR> " ;
}
?>
<!-- Only Display Editor 's Review if it' s been written -->
< ? php
2004-12-21 17:15:27 +00:00
$sql = " SELECT `Title`, `DateAdded`, `Body`, `ExtendedBody`, `Pick` FROM `reviews` WHERE `ID` = ' $id ' LIMIT 1 " ;
2004-12-09 06:34:53 +00:00
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
if ( mysql_num_rows ( $sql_result ) > " 0 " ) {
$row = mysql_fetch_array ( $sql_result );
$title = $row [ " Title " ];
$dateadded = $row [ " DateAdded " ];
2004-12-21 17:15:27 +00:00
$body = nl2br ( $row [ " Body " ]);
$extendedbody = $row [ " ExtendedBody " ];
2004-12-09 06:34:53 +00:00
$pick = $row [ " Pick " ];
$date = gmdate ( " F, Y " , strtotime ( " $dateadded " )); //Create Customizeable Timestamp
?>
< h3 > Editor ' s Review </ h3 >
< ? php
echo " <strong> $title\n " ;
if ( $pick == " YES " ) {
echo " — $date Editors Pick \n " ;
}
echo " </strong><br> \n " ;
?>
2004-12-21 17:15:27 +00:00
< p class = " first " >< ? php echo " $body " ; ?> <?php if ($extendedbody) { echo" <a href=\"?".uriparams()."&id=$id&page=staffreview#more\">More...</a>";} ?></p>
2004-12-09 06:34:53 +00:00
< ? php
}
?>
<!-- Only Display Developers Comments if they ' re written -->
< ? php
$sql = " SELECT `devcomments` FROM `main` WHERE `id`=' $id ' LIMIT 1 " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
$row = mysql_fetch_array ( $sql_result );
if ( $row [ " devcomments " ]) {
$devcomments = nl2br ( $row [ " devcomments " ]);
echo " <h3>Developer Comments:</h3> \n " ;
echo " <p class= \" first \" > $devcomments </p> \n " ;
}
?>
< h3 id = " user-comments " > User Comments </ h3 >
< p >< strong >< a href = " ?<?php echo " " .uriparams(). " & amp ; id = $id & amp ; page = opinion " ; ?> " > Add your own opinion & #187;</a></strong></p>
< ul id = " opinions " >
< ? php
$sql = " SELECT CommentName, CommentTitle, CommentNote, CommentDate, CommentVote FROM `feedback` WHERE ID = ' $id ' AND CommentNote IS NOT NULL ORDER BY `CommentDate` DESC LIMIT 5 " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
$num_results = mysql_num_rows ( $sql_result );
while ( $row = mysql_fetch_array ( $sql_result )) {
$commentname = $row [ " CommentName " ];
$commenttitle = $row [ " CommentTitle " ];
$commentnotes = $row [ " CommentNote " ];
$commentdate = $row [ " CommentDate " ];
$rating = $row [ " CommentVote " ];
$commentdate = gmdate ( " F d, Y g:ia " , strtotime ( " $commentdate " )); //Create Customizeable Datestamp
echo " <li> \n " ;
2005-01-21 19:24:52 +00:00
echo " <h4> $commenttitle </h4> \n " ;
echo " <p class= \" opinions-info \" > " ;
echo " by $commentname , " ;
echo " <a href= \" #permalink \" > $commentdate </a> " ;
echo " </p> \n " ;
2004-12-09 06:34:53 +00:00
echo " <p class= \" opinions-text \" > $commentnotes </P> \n " ;
2004-12-20 13:38:30 +00:00
if ( $rating != NULL ) {
2004-12-09 06:34:53 +00:00
echo " <p class= \" opinions-rating \" title= \" $rating of 5 stars \" > " ;
for ( $i = 1 ; $i <= $rating ; $i ++ ) {
echo " <IMG SRC= \" /images/stars/star_icon.png \" WIDTH=17 HEIGHT=20 ALT= \" * \" > " ;
}
for ( $i = $i ; $i <= 5 ; $i ++ ) {
echo " <IMG SRC= \" /images/stars/graystar_icon.png \" WIDTH=17 HEIGHT=20 ALT= \" \" > " ;
}
echo " </p> \n " ;
2004-12-20 13:38:30 +00:00
}
2004-12-09 06:34:53 +00:00
echo " </li> \n " ;
}
if ( $num_results == " 0 " ) {
echo " <li> \n " ;
echo " <h4>Nobody's Commented on this Theme Yet</h4> \n " ;
echo " <p class= \" opinions-text \" >Be the First! <A HREF= \" moreinfo.php? " . uriparams () . " &id= $id &page=opinion \" >Rate It!</A></p> " ;
echo " </li> \n " ;
}
?>
</ ul >
< p >< strong >< a href = " ?<?php echo " " .uriparams(). " & amp ; id = $id & amp ; & amp ; page = comments " ; ?> " > Read all opinions & #187;</a></strong></p>
< h3 > Theme Details </ h3 >
< ul >
2004-12-18 10:30:37 +00:00
< ? php
//Categories
2004-12-23 20:44:30 +00:00
$sql = " SELECT `CatName` from `categoryxref` TCX INNER JOIN `categories` TC ON TCX.CategoryID=TC.CategoryID WHERE `ID`=' $id ' GROUP BY `CatName` ORDER BY `CatName` ASC " ;
2004-12-18 10:30:37 +00:00
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
$num_results = mysql_num_rows ( $sql_result ); $i = 0 ;
if ( $num_results == " 1 " ) {
$categories = " Category: " ;
} else {
$categories = " Categories: " ;
}
while ( $row = mysql_fetch_array ( $sql_result )) {
$i ++ ;
$categories .= $row [ " CatName " ];
if ( $num_results > $i ) {
$categories .= " , " ;
}
}
?>
< li >< ? php if ( $categories ) { echo " $categories " ; } ?> </li>
< li >< ? php echo " $datestring " ; // Last Updated: September 11, 2004 5:38am ?></li>
2004-12-09 06:34:53 +00:00
< li > Total Downloads : < ? php echo " $downloadcount " ; ?> — Downloads this Week: <?php echo"$populardownloads"; ?></li>
< li > See < a href = " ?<?php echo " " .uriparams(). " & amp ; id = $id & amp ; page = releases " ; ?> " > all previous releases </ a > of this theme .</ li >
2004-12-17 09:57:23 +00:00
< ? php
if ( $homepage ) {
?>
2004-12-09 06:34:53 +00:00
< li > View the Author ' s < a href = " <?php echo " $homepage " ; ?> " > Homepage </ a > for this Theme .</ li >
2004-12-17 09:57:23 +00:00
< ? php
}
?>
2004-12-09 06:34:53 +00:00
</ ul >
< ? php
} else if ( $page == " releases " ) {
echo " <h3>All Releases</h3> " ;
2004-12-18 10:05:24 +00:00
$sql = " SELECT TV.vID, TV.Version, TV.MinAppVer, TV.MaxAppVer, TV.Size, TV.URI, TV.Notes, TV.DateAdded AS VerDateAdded, TA.AppName, TOS.OSName
2004-12-09 06:34:53 +00:00
FROM `version` TV
INNER JOIN applications TA ON TV . AppID = TA . AppID
INNER JOIN os TOS ON TV . OSID = TOS . OSID
WHERE TV . ID = '$id' AND `approved` = 'YES' AND TA . AppName = '$application'
ORDER BY `Version` DESC , `OSName` ASC " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
while ( $row = mysql_fetch_array ( $sql_result )) {
$vid = $row [ " vID " ];
if ( $appvernames [ $row [ " MinAppVer " ]]) {
$minappver = $appvernames [ $row [ " MinAppVer " ]];
} else {
$minappver = $row [ " MinAppVer " ];
}
if ( $appvernames [ $row [ " MaxAppVer " ]]) {
$maxappver = $appvernames [ $row [ " MaxAppVer " ]];
} else {
$maxappver = $row [ " MaxAppVer " ];
}
$filesize = $row [ " Size " ];
$notes = $row [ " Notes " ];
$version = $row [ " Version " ];
$uri = $row [ " URI " ];
$osname = $row [ " OSName " ];
$appname = $row [ " AppName " ];
$filename = basename ( $uri );
2004-12-18 10:05:24 +00:00
$dateadded = $row [ " VerDateAdded " ];
$releasedate = date ( " F d, Y " , strtotime ( " $dateadded " ));
2004-12-09 06:34:53 +00:00
echo " <DIV> " ; //Open Version DIV
//Description & Version Notes
echo " <h3><A HREF= \" moreinfo.php? " . uriparams () . " &id= $id &vid= $vid\ " > $name $version </ A ></ h3 > \n " ;
2004-12-18 10:05:24 +00:00
echo " Released on $releasedate <br> \n " ;
2004-12-09 06:34:53 +00:00
if ( $notes ) {
echo " $notes <br><br> \n " ;
}
//Icon Bar Modules
echo " <DIV style= \" height: 34px \" > " ;
echo " <DIV class= \" iconbar \" > " ;
if ( $appname == " Thunderbird " ) {
2005-01-23 19:20:06 +00:00
$downloadURL = mozupd_buildDownloadURL ( $uri , $name , $version );
echo " <a href= \" $downloadURL\ " onclick = \ " return installTheme(event,' $name $version for Thunderbird'); \" > " ;
2004-12-09 06:34:53 +00:00
} else {
echo " <a href= \" $uri\ " onclick = \ " return installTheme(event,' $name $version '); \" > " ;
}
echo " <IMG SRC= \" /images/download.png \" HEIGHT=34 WIDTH=34 TITLE= \" Install $name (Right-Click to Download) \" ALT= \" \" >Install</A><BR><SPAN class= \" filesize \" >Size: $filesize kb</SPAN></DIV> " ;
echo " <DIV class= \" iconbar \" ><IMG SRC= \" /images/ " . strtolower ( $appname ) . " _icon.png \" HEIGHT=34 WIDTH=34 ALT= \" \" > For $appname :<BR> $minappver - $maxappver </DIV> " ;
if ( $osname !== " ALL " ) {
echo " <DIV class= \" iconbar \" ><IMG SRC= \" /images/ " . strtolower ( $osname ) . " _icon.png \" HEIGHT=34 WIDTH=34 ALT= \" \" >For $osname <BR>only</DIV> " ;
}
echo " </DIV><BR> \n " ;
echo " </DIV> " ;
}
} else if ( $page == " comments " ) {
2004-11-24 08:24:07 +00:00
//Comments/Ratings Page
2004-12-09 06:34:53 +00:00
if ( $_GET [ " numpg " ]) { $items_per_page = escape_string ( $_GET [ " numpg " ]); } else { $items_per_page = " 25 " ;} //Default Num per Page is 25
if ( ! $_GET [ " pageid " ]) { $pageid = " 1 " ; } else { $pageid = escape_string ( $_GET [ " pageid " ]); } //Default PageID is 1
$startpoint = ( $pageid - 1 ) * $items_per_page ;
$sql = " SELECT CommentID FROM `feedback` WHERE ID = ' $id ' " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
$num_pages = ceil ( mysql_num_rows ( $sql_result ) / $items_per_page );
2004-11-24 08:24:07 +00:00
echo " <h3>User Comments:</h3> " ;
if ( $pageid <= $num_pages ) {
$previd = $pageid - 1 ;
if ( $previd > " 0 " ) {
2004-12-09 06:34:53 +00:00
echo " <a href= \" ? " . uriparams () . " &id= $id &page= $page &pageid= $previd\ " >& #171; Previous</A> • ";
2004-11-24 08:24:07 +00:00
}
}
echo " Page $pageid of $num_pages " ;
$nextid = $pageid + 1 ;
if ( $pageid < $num_pages ) {
2004-12-09 06:34:53 +00:00
echo " • <a href= \" ? " . uriparams () . " $id &page= $page &pageid= $nextid\ " > Next & #187;</a>";
2004-11-24 08:24:07 +00:00
}
echo " <BR> \n " ;
2004-12-09 06:34:53 +00:00
?>
< ul id = " opinions " >
< ? php
$sql = " SELECT CommentID, CommentName, CommentTitle, CommentNote, CommentDate, CommentVote, `helpful-yes`,`helpful-no` FROM `feedback` WHERE ID = ' $id ' ORDER BY `CommentDate` DESC LIMIT $startpoint , $items_per_page " ;
2004-11-24 08:24:07 +00:00
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
$num_results = mysql_num_rows ( $sql_result );
while ( $row = mysql_fetch_array ( $sql_result )) {
$commentid = $row [ " CommentID " ];
$name = $row [ " CommentName " ];
$title = $row [ " CommentTitle " ];
$notes = $row [ " CommentNote " ];
$helpful_yes = $row [ " helpful-yes " ];
$helpful_no = $row [ " helpful-no " ];
$date = date ( " l, F j Y " , strtotime ( $row [ " CommentDate " ]));
$rating = $row [ " CommentVote " ];
if ( ! $title ) { $title = " No Title " ; }
if ( ! $name ) { $name = " Anonymous " ; }
2004-12-09 06:34:53 +00:00
echo " <li> \n " ;
echo " <a name= \" $commentid\ " ></ a > \n " ;
2005-01-21 19:24:52 +00:00
echo " <h4> $title </h4> \n " ;
echo " <p class= \" opinions-info \" > " ;
echo " by $name , " ;
echo " <a href= \" # $commentid\ " > $date </ a > " ;
echo " </p> \n " ;
2004-12-09 06:34:53 +00:00
echo " <p class= \" opinions-text \" > $notes </P> \n " ;
2004-12-20 13:38:30 +00:00
if ( $rating != NULL ) {
2004-12-09 06:34:53 +00:00
echo " <p class= \" opinions-rating \" title= \" $rating of 5 stars \" > " ;
for ( $i = 1 ; $i <= $rating ; $i ++ ) {
echo " <IMG SRC= \" /images/stars/star_icon.png \" WIDTH=17 HEIGHT=20 ALT= \" * \" > " ;
}
for ( $i = $i ; $i <= 5 ; $i ++ ) {
echo " <IMG SRC= \" /images/stars/graystar_icon.png \" WIDTH=17 HEIGHT=20 ALT= \" \" > " ;
}
2004-12-20 13:38:30 +00:00
//XXX Meta-Ratings not Production Ready, disabled. Bug 247144.
// if ($helpful_yes>0 or $helpful_no>0) {
// $helpful_total=$helpful_yes+$helpful_no;
// echo"<br>$helpful_yes of $helpful_total people found this comment helpful.<br>\n";
// }
// echo"Was this comment helpful to you? <a href=\"../core/commenthelpful.php?".uriparams()."&id=$id&type=$type&commentid=$commentid&pageid=$pageid&action=yes\">Yes</a> <a href=\"../core/commenthelpful.php?".uriparams()."&id=$id&type=$type&commentid=$commentid&pageid=$pageid&action=no\">No</a>";
2004-12-09 06:34:53 +00:00
echo " <span style= \" font-size: xx-small \" ><a href= \" ../core/reportcomment.php? " . uriparams () . " &id= $id &type= $type &commentid= $commentid &pageid= $pageid &action=report \" ONCLICK= \" return confirm('Report this comment as inappropriate on the site?'); \" >(Report Comment)</a></span> " ;
echo " <BR> " ;
echo " </p> \n " ;
2004-12-20 13:38:30 +00:00
}
2004-12-09 06:34:53 +00:00
echo " </li> \n " ;
2004-11-24 08:24:07 +00:00
}
2004-12-09 06:34:53 +00:00
if ( $num_results == " 0 " ) {
echo " <li> \n " ;
echo " <h4>Nobody's Commented on this Theme Yet</h4> \n " ;
echo " <p class= \" opinions-text \" >Be the First! <A HREF= \" moreinfo.php? " . uriparams () . " &id= $id &page=opinion \" >Rate It!</A></p> " ;
echo " </li> \n " ;
}
?>
</ ul >
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
< ? php
// Begin Code for Dynamic Navbars
if ( $pageid <= $num_pages ) {
$previd = $pageid - 1 ;
if ( $previd > " 0 " ) {
echo " <a href= \" ? " . uriparams () . " &id= $id &page= $page &pageid= $previd\ " >& #171; Previous</A> • ";
2004-11-24 08:24:07 +00:00
}
2004-12-09 06:34:53 +00:00
}
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
echo " Page $pageid of $num_pages " ;
$nextid = $pageid + 1 ;
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
if ( $pageid < $num_pages ) {
echo " • <a href= \" ? " . uriparams () . " &id= $id &page= $page &pageid= $nextid\ " > Next & #187;</a>";
2004-11-24 08:24:07 +00:00
}
2004-12-09 06:34:53 +00:00
echo " <BR> \n " ;
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
//Skip to Page...
if ( $num_pages > 1 ) {
echo " Jump to Page: " ;
$pagesperpage = 9 ; //Plus 1 by default..
$i = 01 ;
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
//Dynamic Starting Point
if ( $pageid > 11 ) {
$nextpage = $pageid - 10 ;
}
2004-10-07 06:36:17 +00:00
2004-12-09 06:34:53 +00:00
$i = $nextpage ;
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
//Dynamic Ending Point
$maxpagesonpage = $pageid + $pagesperpage ;
//Page #s
while ( $i <= $maxpagesonpage && $i <= $num_pages ) {
if ( $i == $pageid ) {
echo " <SPAN style= \" color: #FF0000 \" > $i </SPAN> " ;
} else {
echo " <A HREF= \" ? " . uriparams () . " &id= $id &page= $page &pageid= $i\ " > $i </ A >& nbsp ; " ;
}
$i ++ ;
}
2004-11-24 08:24:07 +00:00
}
2004-12-09 06:34:53 +00:00
if ( $num_pages > 1 ) {
echo " <br> \n Comments per page: \n " ;
$perpagearray = array ( " 25 " , " 50 " , " 100 " );
foreach ( $perpagearray as $items_per_page ) {
echo " <A HREF= \" ? " . uriparams () . " &id= $id &page= $page &pageid=1 \" > $items_per_page </A> " ;
2004-11-24 08:24:07 +00:00
}
}
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
} else if ( $page == " previews " ) {
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
// Item Previews Tab
echo " <h2>Previews for $name </h2> \n " ;
$sql = " SELECT `PreviewURI`,`caption` from `previews` WHERE `ID`=' $id ' and `preview`='NO' ORDER BY `PreviewID` ASC " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
while ( $row = mysql_fetch_array ( $sql_result )) {
$uri = $row [ " PreviewURI " ];
$caption = $row [ " caption " ];
echo " <h4> $caption </h4> " ;
list ( $src_width , $src_height , $type , $attr ) = getimagesize ( " $websitepath / $uri " );
//Scale Image Dimensions
$dest_width = " 690 " ; // Destination Width /$tn_size_width
$dest_height_fixed = " 520 " ; // Destination Height / $tn_size_height (Fixed)
if ( $src_width <= $dest_width AND $src_height <= $dest_width ) {
$dest_width = $src_width ;
$dest_height = $src_height ;
} else {
$dest_height = ( $src_height * $dest_width ) / $src_width ; // (Aspect Ratio Variable Height
if ( $dest_height > $dest_height_fixed ) {
$dest_height = $dest_height_fixed ;
$dest_width = ( $src_width * $dest_height ) / $src_height ;
}
}
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
echo " <img src= \" $uri\ " alt = \ " $caption\ " width = \ " $dest_width\ " height = \ " $dest_height\ " >< br > \n " ;
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
}
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
} else if ( $page == " staffreview " ) {
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
//Staff/Editor Review Tab
echo " <h3>Editor Review</h3> \n " ;
2004-12-21 17:15:27 +00:00
$sql = " SELECT TR.ID, `Title`, TR.DateAdded, `Body`, `ExtendedBody`, `Type`, `Pick`, TU.UserName FROM `reviews` TR
2004-12-09 06:34:53 +00:00
INNER JOIN main TM ON TR . ID = TM . ID
INNER JOIN userprofiles TU ON TR . AuthorID = TU . UserID
WHERE `Type` = 'T' AND TR . ID = '$id' ORDER BY `rID` DESC LIMIT 1 " ;
$sql_result = mysql_query ( $sql , $connection ) or trigger_error ( " MySQL Error " . mysql_errno () . " : " . mysql_error () . " " , E_USER_NOTICE );
$num_results = mysql_num_rows ( $sql_result );
while ( $row = mysql_fetch_array ( $sql_result )) {
$id = $row [ " ID " ];
$title = $row [ " Title " ];
$dateadded = $row [ " DateAdded " ];
2004-12-21 17:15:27 +00:00
$body = nl2br ( $row [ " Body " ]);
$extendedbody = nl2br ( $row [ " ExtendedBody " ]);
2004-12-09 06:34:53 +00:00
$pick = $row [ " Pick " ];
$username = $row [ " UserName " ];
$date = gmdate ( " F, Y " , strtotime ( " $dateadded " )); //Create Customizeable Timestamp
$posteddate = date ( " F j Y, g:i:sa " , strtotime ( " $dateadded " ));
echo " <h3> $title\n " ;
if ( $pick == " YES " ) {
echo " — $date Editors Pick \n " ;
}
echo " </h3> \n " ;
echo " Posted on $posteddate by $username <br> \n " ;
echo " <p class= \" first \" > $body </p> \n " ;
2004-12-21 17:15:27 +00:00
if ( $extendedbody ) {
echo " <a name= \" more \" ></a> \n " ;
echo " <p> $extendedbody </p> \n " ;
}
2004-11-24 08:24:07 +00:00
}
2004-12-09 06:34:53 +00:00
$typename = " theme " ;
if ( $num_results == " 0 " ) {
echo " This $typename has not yet been reviewed.<BR><BR>
2004-11-24 08:24:07 +00:00
2004-12-09 06:34:53 +00:00
To see what other users think of this $typename , view the < A HREF = \ " moreinfo.php? " . uriparams () . " &id= $id &page=comments \" >User Comments...</A>
" ;
}
2004-11-24 08:24:07 +00:00
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
} else if ( $page == " opinion " ) {
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
//My Opinion Tab
echo " <h3>Your Comments about $name :</h3> " ;
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
if ( $_GET [ " error " ] == " norating " ) {
echo " <DIV class= \" errorbox \" > \n
Your comment submission had the following error ( s ), please fix these errors and try again .< br > \n
& nbsp ; & nbsp ; & nbsp ; Rating cannot be left blank .< br > \n
& nbsp ; & nbsp ; & nbsp ; Review / Comments cannot be left blank .< br > \n
</ DIV > \n " ;
}
?>
< FORM NAME = " opinon " METHOD = " POST " ACTION = " ../core/postfeedback.php?<?php echo uriparams(); ?> " >
< DIV >
2004-12-22 11:46:55 +00:00
< input name = " formkey " type = " hidden " value = " <?php print(md5(substr(md5(mt_rand()),0,10))); ?> " >
2004-12-09 06:34:53 +00:00
< INPUT NAME = " id " TYPE = " HIDDEN " VALUE = " <?php echo " $id " ; ?> " >
< INPUT NAME = " vid " TYPE = " HIDDEN " VALUE = " <?php echo " $vid " ; ?> " >
< INPUT name = " type " type = " hidden " value = " E " >
Your Name :*< BR >
< INPUT NAME = " name " TYPE = " TEXT " SIZE = 30 MAXLENGTH = 30 >< BR >
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
Your E - Mail ( optional ) :< BR >
< INPUT NAME = " email " TYPE = " TEXT " SIZE = 30 MAXLENGTH = 100 >< BR >
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
Rating :*< BR >
< SELECT NAME = " rating " >
< OPTION value = " " > Rating :
< OPTION value = " 5 " > 5 Stars
< OPTION value = " 4 " > 4 Stars
< OPTION value = " 3 " > 3 Stars
< OPTION value = " 2 " > 2 Stars
< OPTION value = " 1 " > 1 Star
< OPTION value = " 0 " > 0 Stars
</ SELECT >< BR >
2004-10-07 06:36:17 +00:00
2004-12-09 06:34:53 +00:00
Title :*< BR >
< INPUT NAME = " title " TYPE = " TEXT " SIZE = 30 MAXLENGTH = 50 >< BR >
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
Review / Comments :*< BR >
< TEXTAREA NAME = " comments " ROWS = 5 COLS = 55 ></ TEXTAREA >< BR >
< INPUT NAME = " submit " TYPE = " SUBMIT " VALUE = " Post " >& nbsp ; & nbsp ; < INPUT NAME = " reset " TYPE = " RESET " VALUE = " Reset " >< BR >
< SPAN class = " smallfont " >* Required Fields </ SPAN >
</ DIV >
</ FORM >
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
< ? php
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
} // End Pages
?>
2004-08-29 20:55:50 +00:00
2004-12-09 06:34:53 +00:00
</ div >
<!-- closes #mainContent-->
</ div >
<!-- closes #mBody-->
2004-08-29 20:55:50 +00:00
< ? php
include " $page_footer " ;
?>
2004-12-09 06:34:53 +00:00
</ body >
2005-01-21 19:24:52 +00:00
</ html >