//db parameters

$db_username = ‘shoot_wp’;

$db_password = ‘moya0623’;//31404philmar

$db_database = ‘mjspade_wpfresh’;

$db_lhost = ‘localhost:3306’;

//connect to the database

mysql_connect($db_lhost, $db_username, $db_password);

@mysql_select_db($db_database);

//get data from database — !IMPORTANT, the “LIMIT 5” means how many posts will appear. Change the 5 to any whole number.

$hrquery = “Select * FROM posts,term_relationships WHERE post_status=’publish’ AND term_taxonomy_id =’16’ AND ID = object_id ORDER BY post_date DESC LIMIT 7”;
$spquery = “Select * FROM posts,term_relationships WHERE post_status=’publish’ AND term_taxonomy_id =’15’ AND ID = object_id ORDER BY post_date DESC LIMIT 7”;

$hrquery_result = mysql_query($hrquery);
$spquery_result = mysql_query($spquery);

$hrnum_rows = mysql_numrows($hrquery_result);
$spnum_rows = mysql_numrows($spquery_result);

//close database connection

mysql_close();

// html page starts after ?gt;

The Shooting Range

–gt;

// START of “Frontpage Slideshow” settings
$nameOfSlideshowToDisplay = “myslideshow”;

// Enter the name of your slideshow. Slideshows are in folders inside /fpss/slideshows/.
$URLofyoursite = “http://www.theshootingrange.net”;

// Enter your site’s URL.
$AbsoluteServerPathofyoursite = “/var/www/vhosts/theshootingrange.net/httpdocs”;
// Enter the root path of your site on the server.

// do not edit below this line
include_once($AbsoluteServerPathofyoursite.”/fpss/mod_fpslideshow.php”);
// END of “Frontpage Slideshow” settings
?gt;

click here

The Sports Session

//start a loop that starts $i at 0, and make increase until it’s at the number of rows

for($i=0; $ilt; $spnum_rows; $i++){

//assign data to variables, $i is the row number, which increases with each run of the loop

$blog_date = mysql_result($spquery_result, $i, “post_date”);

$blog_title = mysql_result($spquery_result, $i, “post_title”);

$blog_content = mysql_result($spquery_result, $i, “post_content”);

$blog_permalink = mysql_result($spquery_result, $i, “guid”);

//format date

$blog_date = strtotime($blog_date);

$blog_date = strftime(“%b %e”, $blog_date);

//the following HTML content will be generated on the page as many times as the loop runs. In this case 5.

?gt;

: 

} //end the for loop

?gt;

The Shooting Range Forum

The High Limit Room

//start a loop that starts $i at 0, and make increase until it’s at the number of rows

for($i=0; $ilt; $hrnum_rows; $i++){

//assign data to variables, $i is the row number, which increases with each run of the loop

$blog_date = mysql_result($hrquery_result, $i, “post_date”);

$blog_title = mysql_result($hrquery_result, $i, “post_title”);

$blog_content = mysql_result($hrquery_result, $i, “post_content”);

$blog_permalink = mysql_result($hrquery_result, $i, “guid”);

//format date

$blog_date = strtotime($blog_date);

$blog_date = strftime(“%b %e”, $blog_date);

//the following HTML content will be generated on the page as many times as the loop runs. In this case 5.

?gt;

: 

} //end the for loop

?gt;


Leave a Reply

Your email address will not be published. Required fields are marked *

My Wordpress Blog