mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 19:41:55 +02:00
Switched mysql functions to Dba
This commit is contained in:
parent
c405965ccb
commit
f83fa48e5c
6 changed files with 29 additions and 44 deletions
|
@ -5,24 +5,21 @@
|
|||
|
||||
|
||||
if(!empty($_SESSION['twitterusername'])) {
|
||||
$link = mysql_connect( Config::get('database_hostname'), Config::get('database_username'), Config::get('database_password') ) or die( mysql_error() );;
|
||||
mysql_select_db( Config::get('database_name') , $link) or die("Couldnt connect " . mysql_error() );
|
||||
|
||||
$nowplayingQuery = "SELECT song.title,artist.name FROM song,now_playing,artist WHERE song.id = now_playing.object_id AND artist.id = song.artist";
|
||||
debug_event("Twitter", "Now Playing query: " . $nowplayingQuery, "6");
|
||||
$nowplayingRun = mysql_query($nowplayingQuery) or die( mysql_error);
|
||||
$nowplayingResults = mysql_fetch_array($nowplayingRun) or die( mysql_error() );
|
||||
|
||||
$nowplayingRun = Dba::read($nowplayingQuery);
|
||||
$nowplayingResults = Dba::fetch_assoc($nowplayingRun);
|
||||
|
||||
$return = $nowplayingResults['title'] . " by " . $nowplayingResults['name'];
|
||||
debug_event("Twitter", "Song from DB is: " . $return, "5");
|
||||
|
||||
$selectquery = "SELECT * FROM twitter_users WHERE username = '" . $_SESSION['twitterusername'] . "' AND ampache_id = " . $_SESSION['userdata']['uid'];
|
||||
debug_event("Twitter", "Select query: " . $selectquery, "6");
|
||||
$selectrun = mysql_query($selectquery) or die( mysql_error() );
|
||||
|
||||
$result = mysql_fetch_array($selectrun) or die( mysql_error() );
|
||||
|
||||
mysql_close($link);
|
||||
$selectrun = Dba::read($selectquery);
|
||||
$result = Dba::fetch_assoc($selectrun);
|
||||
|
||||
$twitteroauth = new TwitterOAuth( Config::get('twitter_consumer_key'), Config::get('twitter_consumer_secret'), $result['oauth_token'], $result['oauth_secret']);
|
||||
$user_info = $twitteroauth->get('account/verify');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue