#!/usr/bin/perl #------------------------------------------------------------------------------# # NAME: : enewsViewNewsArticle.cgi # # PROGRAMMER : LO # # DATE : 00/00/2001 # # # # DESCRIPTION : View a user selected news article. # # # #------------------------------------------------------------------------------# # This script is copyright Integrated System Technologies 2001 and beyond # #------------------------------------------------------------------------------# # COMPLETE # #------------------------------------------------------------------------------# require("enewsLibrary.pl"); use Time::Local; use DBI; #----------------------------------------# # Initialisation. # #----------------------------------------# &readParse(*input); #----------------------------------------# # Main Algorithm. # #----------------------------------------# #if ($input{'article_id'} eq "") { if ($input{'article_id'}) { # Get the record from the database. $cursor = ""; $dbh = DBI->connect("DBI:mysql:media_email_db:$sqlServerDomain", "$mysqlUsername", "$mysqlPassword") or &errorMessagePage("DBI Problem Reported.

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # Select by article. $sql = "SELECT * FROM articles_tbl WHERE article_id = $input{'article_id'}"; # Grab the data from the database. $cursor = $dbh -> prepare($sql); $cursor -> execute() or &errorMessagePage("DBI Problem Reported.



Actual error reported:

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); if ($hashRecordPtr = $cursor -> fetchrow_hashref()) { # Is there a picture? if ($$hashRecordPtr{'picture_url'}) { $pictureHTML = "\"News"; } else { $pictureHTML = ""; } $cursor -> finish(); $dbh -> disconnect; } else { &errorMessageBox("Sorry, there is no news article with the id you provided."); exit(0); } } else { #$sql = "SELECT * FROM articles_tbl ORDER BY creation_time DESC"; #&errorMessagePage('Please specify a news article.') $cursor = ""; $dbh = DBI->connect("DBI:mysql:media_email_db:$sqlServerDomain", "$mysqlUsername", "$mysqlPassword") or &errorMessagePage("DBI Problem Reported.

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # Select by article. $sql = "SELECT * FROM articles_tbl ORDER BY creation_time DESC"; # Grab the data from the database. $cursor = $dbh -> prepare($sql); $cursor -> execute() or &errorMessagePage("DBI Problem Reported.



Actual error reported:

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); if ($hashRecordPtr = $cursor -> fetchrow_hashref()) { # Is there a picture? if ($$hashRecordPtr{'picture_url'}) { $pictureHTML = "\"News"; } else { $pictureHTML = ""; } $cursor -> finish(); $dbh -> disconnect; } } print <<"HTML1"; Cache-control: no-cache Pragma: no-cache Content-type: text/html\n ist media
 
 
 
 
 
 
HTML1 $cursor = ""; $dbh = DBI->connect("DBI:mysql:media_email_db:$sqlServerDomain", "$mysqlUsername", "$mysqlPassword") or &errorMessagePage("DBI Problem Reported.

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # Select by article. $sql = "SELECT * FROM articles_tbl ORDER BY creation_time DESC"; # Grab the data from the database. $cursor = $dbh -> prepare($sql); $cursor -> execute() or &errorMessagePage("DBI Problem Reported.



Actual error reported:

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); $hashRecordPtr2 = $cursor -> fetchrow_hashref(); do { $articleDate = $$hashRecordPtr2{'dd'}."\\".$$hashRecordPtr2{'mm'}."\\".$$hashRecordPtr2{'yyyy'}; $articleExcert = ""; $articleExcert = substr($$hashRecordPtr2{'article'},undef,65); $articleExcert = "'$articleExcert.....'"; print "$$hashRecordPtr2{'title'}

"; } while ($hashRecordPtr2 = $cursor -> fetchrow_hashref()); print <<"HTML1";
  $$hashRecordPtr{'title'}

$pictureHTML$$hashRecordPtr{'article'}

DATE: $$hashRecordPtr{'dd'}/$$hashRecordPtr{'mm'}/$$hashRecordPtr{'yyyy'}
 
 
HTML1 # Get the record from the database. # $cursor = ""; # $dbh = DBI->connect("DBI:mysql:media_email_db:$sqlServerDomain", # "$mysqlUsername", # "$mysqlPassword") or &errorMessagePage("DBI Problem Reported.

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # # # Select by article. # # $sql = "SELECT * FROM articles_tbl ORDER BY creation_time DESC"; # # # Grab the data from the database. # # $cursor = $dbh -> prepare($sql); # $cursor -> execute() or &errorMessagePage("DBI Problem Reported.



Actual error reported:

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # $hashRecordPtr = $cursor -> fetchrow_hashref(); # do { # $articleDate = $$hashRecordPtr{'dd'}."\\".$$hashRecordPtr{'mm'}."\\".$$hashRecordPtr{'yyyy'}; # $articleExcert = ""; # $articleExcert = substr($$hashRecordPtr{'article'},undef,65); # $articleExcert = "'$articleExcert.....'"; # print "

$$hashRecordPtr{'title'}

"; # # } while ($hashRecordPtr = $cursor -> fetchrow_hashref()); # # $cursor -> finish(); # $dbh -> disconnect; $cursor -> finish(); $dbh -> disconnect; #----------------------------------------# # End. # #----------------------------------------# exit(0);