Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Reading information from CPG database  (Read 2808 times)

0 Members and 1 Guest are viewing this topic.

dreams83

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 54
Reading information from CPG database
« on: November 10, 2006, 05:42:17 am »

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.
« Last Edit: November 10, 2006, 09:58:39 am by GauGau »
Logged

dreams83

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 54
Re: Reading information from CPG database
« Reply #1 on: November 10, 2006, 09:52:10 am »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Reading information from CPG database
« Reply #2 on: November 10, 2006, 09:58:26 am »

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.
Logged

dreams83

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 54
Re: Reading information from CPG database
« Reply #3 on: November 10, 2006, 05:48:38 pm »

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.
Code: [Select]
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.
Logged
Pages: [1]   Go Up
 

Page created in 0.043 seconds with 20 queries.