Changeset 1425 for feedmelinks/bin/add-link.pl
- Timestamp:
- 03/16/07 10:17:44 (2 years ago)
- Files:
-
- feedmelinks (modified) (1 prop)
- feedmelinks/bin/add-link.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks
- Property svn:ignore changed from
.htaccess
cgi-bin
cheat
logs
portal.php
testing
the-lost-urls
utils.inc.php
wall-of-ancients.php
work
*webalizer*
_assets
_profiling
TODO
info.php
setup
_comments
local-remote-root
.DS_Store
flash
_logs
usage
mint
cgi-bin
dev
please
usr
blog
xfer
to
.htaccess
cgi-bin
cheat
logs
portal.php
testing
the-lost-urls
utils.inc.php
wall-of-ancients.php
work
*webalizer*
_assets
_profiling
TODO
info.php
setup
_comments
local-remote-root
.DS_Store
flash
_logs
usage
mint
cgi-bin
dev
please
usr
blog
xfer
_backups
- Property svn:ignore changed from
feedmelinks/bin/add-link.pl
r1402 r1425 28 28 my $tagName = "new"; 29 29 30 open(LOG, ">>" . get_webserver_root() . "/_logs/mail.log") or die "can't open file";30 open(LOG, ">>" . FeedMeLinks::Environment::get_webserver_root() . "/_logs/mail.log") or die "can't open file"; 31 31 print LOG "--- starting run ---\n" if( $verbose ); 32 32 … … 78 78 if( $headersDone && $title && $submitter && $link ) { 79 79 print LOG "adding link to db\n" if( $verbose ); 80 my $dsn = "DBI:mysql:database=" . get_database_name() . ";host=localhost"; # FIXME: need to retrieve this from our config arrays...81 my $dbh = DBI->connect($dsn, get_database_user(),get_database_password() );80 my $dsn = "DBI:mysql:database=" . FeedMeLinks::Environment::get_database_name() . ";host=localhost"; # FIXME: need to retrieve this from our config arrays... 81 my $dbh = DBI->connect($dsn, FeedMeLinks::Environment::get_database_user(), FeedMeLinks::Environment::get_database_password() ); 82 82 83 83 if( ! $dbh ) { … … 86 86 } 87 87 88 my $qs = "SELECT userid, password FROM linksUsers WHERE email = ? OR email = ? LIMIT 1";88 my $qs = "SELECT userid, password FROM users WHERE email = ? OR email = ? LIMIT 1"; 89 89 my $sth = $dbh->prepare( $qs ); 90 90 … … 111 111 print LOG "$now [link-by-mail] $dbUser added $linkID\n"; 112 112 113 $qs = "SELECT ID FROM linksGroups WHERE name = ? AND userid = ? AND isPrivate IS NULL";113 $qs = "SELECT ID FROM tags WHERE name = ? AND userid = ? AND isPrivate IS NULL"; 114 114 $sth = $dbh->prepare( $qs ); 115 115 $sth->execute( $tagName, $dbUser ); … … 118 118 if( ! $tagID ) { 119 119 print LOG "couldn't find a tag named $tagName; trying to insert it\n" if( $verbose ); 120 $qs = "INSERT INTO linksGroups VALUES( NULL, ?, ?, NULL, NULL)";120 $qs = "INSERT INTO tags VALUES( NULL, ?, ?, NULL, NULL)"; 121 121 print LOG "SQL: $qs with $dbUser, $tagName\n" if( $verbose ); 122 122 $sth = $dbh->prepare( $qs ); … … 136 136 if( $tagID ) { 137 137 print LOG "found existing tag as ID $tagID\n" if( $verbose ); 138 $qs = "INSERT INTO links CategoriesXRef VALUES( ?, ?)";138 $qs = "INSERT INTO links_tags_xref VALUES( ?, ?)"; 139 139 $sth = $dbh->prepare( $qs ); 140 140 $sth->execute( $linkID, $tagID ); … … 163 163 print LOG "--- ending run ---\n\n" if( $verbose ); 164 164 close(LOG); 165 166 From root@raptor.webhostserver.biz Thu Mar 08 13:20:49 2007167 Return-path: <root@raptor.webhostserver.biz>168 Envelope-to: add@feedmelinks.com169 Delivery-date: Thu, 08 Mar 2007 13:20:49 -0700170 Received: from fml by raptor.webhostserver.biz with local-bsmtp (Exim 4.63)171 (envelope-from <root@raptor.webhostserver.biz>)172 id 1HPP6P-0007Ie-RH173 for add@feedmelinks.com; Thu, 08 Mar 2007 13:20:45 -0700174 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on175 raptor.webhostserver.biz176 X-Spam-Level:177 X-Spam-Status: No, score=-0.0 required=5.0 tests=NO_RELAYS autolearn=ham178 version=3.1.8179 Received: from root by raptor.webhostserver.biz with local (Exim 4.63)180 (envelope-from <root@raptor.webhostserver.biz>)181 id 1HPP6O-0007IO-ND182 for add@feedmelinks.com; Thu, 08 Mar 2007 13:20:41 -0700183 To: add@feedmelinks.com184 Subject: test185 Message-Id: <E1HPP6O-0007IO-ND@raptor.webhostserver.biz>186 From: root <root@raptor.webhostserver.biz>187 Date: Thu, 08 Mar 2007 13:20:40 -0700188 189 test support190