Reading information from CPG database Reading information from CPG database
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Reading information from CPG database

Started by dreams83, November 10, 2006, 05:42:17 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dreams83

I have a site with mp3s and I want to hide the direct link to the mp3 files from the user so I am using a flash mp3 player to play the file mp3 file. What I wanted to do it to put the link to the mp3 in an xml file and have the flash mp3 player reading the direct link from within the xml file so that the normal user wouldn't be able to get the direct link to the mp3 file.

I was looking in the cpg148_pictures table on the database and it seems like every song has an unique pid. I have an idea of what i need to do but I don't know how to access the database and extracting the information I want like "title", "filename" and "path". I look at some of the plugins for cpg and they have functions in there does look it they are talking with the database but I don't know much about them.

Can you guys point in the direction of where I could find information on how to access the cpg database?


Thank You.

dreams83

The thread can be mark as solved now :-)
Was able mess my way through it haha. It was quite simple haha.

Joachim Müller

Thanks for resolving your thread. For the benefit of others with similar issues we'd appreciate if you posted what you actually did to solve this.

dreams83

I am using the plugin 'Link-Codes-And-Tags' by: Jake Russell

and using the flash mp3 player at http://jeroenwijering.com/?item=Flash_MP3_Player to play my files instead.

and using this code to write the xml file for every file i have on the server by their unique PID.
if (stristr($normal_url,".MP3") ){
//creating xml file
if (!file_exists("playlistxml/$songpid" . "." . "xml")){

$file=fopen("playlistxml/$songpid" . "." . "xml","x");

echo fwrite($file,"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
echo fwrite($file,"<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">\n");
echo fwrite($file,"<title>eHmongMusic</title>\n");
echo fwrite($file,"<info>http://www.ehmongmusic.com/</info>\n");
echo fwrite($file,"<trackList>\n");
echo fwrite($file,"<track>\n");
echo fwrite($file,"<annotation>"."$songtitle"."</annotation>\n");
echo fwrite($file,"<location>"."http://www.ehmongmusic.com/"."$normal_url"."</location>\n");
echo fwrite($file,"</track>\n");
echo fwrite($file,"</trackList>\n");
echo fwrite($file,"</playlist>\n");

fclose($file);
}
}


Using these

$songpid = $CURRENT_PIC_DATA['pid'];
$songtitle = $CURRENT_PIC_DATA['title'];
and the string $normal_url that is already in the plugins

to get the title and pid of the mp3 files.