Jump to content

Arkane

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Everything posted by Arkane

  1. Ok. pressed the submit button while getting up to tend to kids, so have missed the modify window. Sorry folks The problem I have is with opening the file at the start. I have used $dbhandle = sqlite_open('C:\Users\Steve\AppData\Roaming\XBMC\userdata\Database\MyVideos34.db', 0666, $sqliteerror); however this gives me an error of "Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in C:\xampp\htdocs\XBMC.php on line 2" I have spoken to XBMC devs, and the file is an SQLite3 file, but is not encrypted. Can anyone tell me how to open this. I have confirmed that SQLite3 is installed in the XAMPP installation using phpinfo() SQLite3 module version 0.7-dev SQLite Library 3.7.7.1
  2. Hey guys, I've got a media player that writes to an SQLite database (XBMC), and due to file changes I need to make a mass edit to this. I can't do it in the program itself, so I figured I'd use a local XAMPP installation to edit it using PHP. I've done PHP stuff before, but not for quite a while and I'm a little rusty. Sadly, my problem has come straight at the start of the
  3. Thanks again mjdamato. I tried that, but I got an error first off. It seems you've missed a slight bit in the middle. The line "$gg = ($rgb >> & 0xFF;" should be "$gg = ($rgb >> & 0xFF; Anyway, it does greyscale, except that I lose my transparent background with it, which turns completely black. Other than that, the rest of it looks very good, and so I think it would work perfectly for complete images. Cheers man.
  4. Hey mjdamato, cheers for the reply. I want the image to be coloured on the left, and greyed on the right. The link you left was just pointing to this thread. I've not had any experience converting the images to greyscale myself, I've generally just used imagesfilter($img, IMG_FILTER_GRAYSCALE) to do it for me, but then I have no idea about resources that that may use in comparison. I guess if I do it with my own function then it's probably the same as adding the filter, so would be less resource intensive to only do half. I just have a tendency to prefer built ins. Spoilt really.
  5. I'm trying to create a script that will automatically dull out a percentage of an image, specified via a GET value. I have the image created using imagecopy() and it is working fine, but I'm not sure how to get it to set GRAYSCALE to the percentage specified. I considered copying the image twice, copying the first x% to one resource, and the remaining % to the other, greyscaling it, then recombining the two, but I wasn't entirely sure how to, and thought there may be a better way to do it anyway. Can anyone help me out, or point me towards the correct solution. Much appreciated.
  6. OK, thank you very much, I had no idea how to do that, it'll be perfect. Cheers mate
  7. Hey, thanks for the reply. Unfortunately, I made a major mistake in my description. what I actually want is the ability to do this from a radio box, not a checkbox. I tried adapting the method given, but obviously it wouldn't work properly as the radios all have the same name. Is there any way to change this to work with radios?
  8. Hey guys, I've been asked to make a sort of admin system for a mysql database. Theres very little to it, but for some reason it is demanded of me. What I have just now is 2 checkboxs, and the record name displaying. The checkboxes are written from the php, and have values of "approve" and "delete", while the names of both are $sqlresult->id What I need is for them to process at the other end, so that every id with a value of "approve" will be updated, and "delete" will be deleted from the records, but I don't really have a clue how to do it. Can anyone give any pointers? Cheers
  9. thank you Salathe. that worked perfectly.
  10. Hey, I've made a script to get data from another page which uses DOMDocument. It works, but only if all of the tags exist. For instance, I use $var = $dom->getElementById('ctl00_mainContent_identityStrip_lblRank')->nodeValue; The problem is, that the page I'm taking it from doesn't always have the element with that id. I'm checking for multiple on the page, but some are there and some arent, but the script breaks if they aren't all there. How can I check if the node exists, and then only create the variable if it does?
  11. thanks for getting back so quickly. I've tried that, but I'm not having any luck with it. Basically my entire code: <?php $url = "http://www.advanscene.com/html/Releases/dbrelpsp.php?id=1908"; $raw = file_get_contents($url); preg_match('~<td class=\"*+\">Serial Code</td>\s<td class=\"*+\">([0-9\-]+)</td>~', $raw, $matches); print_r($matches); ?> I'm intending to take about 4 different pieces from the page and write them to variables, but obviously getting nowhere. Even trying the bit you gave me displays nothing but "Array ( )". What am i missing?
  12. Hey, I'm trying to write a script to get data off of another site (with admins approval) but I'm having a bit of a problem to take the actual data. I'm trying to use preg_match to find the data I need, but just cant get the thing to work for anything more complicated that telling me if there is a t in test. <td class="reltdd">Serial Code</td> <td class="reltdv">5445-9826</td> This is the html that i am trying to scrape. theres more, but its all the same pretty much. What I'm looking to get is the '5445-9826' but since the td is a class that is referred to multiple times, the only thing unique to the date is the 'Serial Code' text. I've gotten the site info via file_get_contents() and its all in the one variable - $raw . I've tried preg_match("/<td class="reltdd">(.*)</td>/", $html, $matches); echo $matches; but it had no return whatsoever. i have also echoed $html so I know it got the data correctly. I know that what I have there should only return 'Serial Code' but sinceI can't even get that to work I have no chance with the rest. Any help would be appreciated.
  13. HEy, I'm trying to write a script to get data off of another site (with admins approval) but I'm having a bit of a problem to take the actual data. I'm trying to use preg_match to find the data I need, but just cant get the thing to work for anything more complicated that telling me if there is a t in test. <td class="reltdd">Serial Code</td> <td class="reltdv">5445-9826</td> This is the html that i am trying to scrape. theres more, but its all the same pretty much. What I'm looking to get is the '5445-9826' but since the td is a class that is referred to multiple times, the only thing unique to the date is the 'Serial Code' text. I've gotten the site info via file_get_contents() and its all in the one variable - $raw . I've tried preg_match("/<td class="reltdd">(.*)</td>/", $html, $matches); echo $matches; but it had no return whatsoever. i have also echoed $html so I know it got the data correctly. I know that what I have there should only return 'Serial Code' but sinceI can't even get that to work I have no chance with the rest. Any help would be appreciated.
  14. Thanks for that Kat. I've tied it, and it does indeed work, at least for the rudimentary trials I've tried so far. Just to be anuisance though, I'm looking t set it in the PH t cnnect to the file. It's something which I'm going to be putting on a remote computer which I don't have the ODBC thingy access to in control panel. Cheers anyways.
  15. Hey folks. I'm looking for some pointers. I've been hunting all over the internet, but haven't found myself any answers. What I'm looking to do is connect to an MS Access 2007 Database (*.accdb). the one I'm using is kept in the same folder as the php script, and is called "Games.accdb". There are 2 tables in it, the one I want being called "Titles", and it has 3 fields - "ID", "Title", and "Serial". Can anyone give me any pointers as to how to read from this, and ideally how to add more to it from php? Thanks all.
  16. Hey folks, I'm sorry to come asking for help with so little to contribute, but I'm trying to learn by throwing myself in at the deep end, and I'm having some trouble. I'm trying to make a rotating image on my site. Ideally I'd like it to be usable from any site for a signature or banner, but I realise this may not be possible. So far I'm using this http://panmental.de/public/programming_projects/Slideshow%20script%20in%20PHP/live/ as a basis, because it works similarly to what I'm after, but I don't know how to modify it to be called into the page I want. As this is done for one page, and I want it as an inline image is where my problems is coming. Can anyone give me any pointers or suggestions so that I can have it working as needed. All the images I intend to use will be often switched out in the folder, but they will always be the same size and will not need any resizing. Thanks for any help
  17. Hey guys, I've been playing about, trying to move a bunch of things into a MySQL database from XML. I've gotten the backbone written, but having problems actually getting it to import. I'm not sure if I've missed something in config or whatever, but its not working for me. mysql_query("INSERT INTO $table VALUES ('', '$name', '$age', '$email')"); The table fields are all VARCHARs, except for the first, which is an INT, set to unsigned and auto-inc. I've copied this from another I've done previously on a different host, so I guess that may be the problem. Basically, it doesn't add unless I specify what the first is to be set to, but it works fine on the other site. MySQL version is 5.1.37, and the error I'm getting is "Incorrect integer value: '' for column 'id' at row 1" Basically can anyone tell me what would make my db automatically fill the field... or perhaps why it works on one and not the other? Thanks
  18. Here's a bit of the code. I've trimmed it down, but its pretty much all the same, just there are more fields used in the complete. $i=0; while ($i < $num) { $gameid=mysql_result($result,$i,"gameid"); $title=mysql_result($result,$i,"title"); $short=mysql_result($result,$i,"abbrev"); $xmlud = fopen($xml, 'a') or die("can't open file"); fwrite($xmlud, utf8_encode(" <game name=\"".htmlspecialchars($gameid)."\">\r\n")); fwrite($xmlud, utf8_encode(" <title>".htmlspecialchars($title, ENT_NOQUOTES)."</title>\r\n")); fwrite($xmlud, utf8_encode(" <short-title>".htmlspecialchars($short, ENT_NOQUOTES)."</short-title>\r\n")); fwrite($xmlud, utf8_encode(" </game>\r\n")); fclose($xmlud); $i++; } The actual offending field is the gameid field. When it pulls the data from MySQL it has the sybols and the like as needed, it just doesnt write them into the file.
  19. I need some help to output the data from a MySQL database to on XML file. At the moment I have it done using fwrite because I need it all to be in UTF-8, but I keep running into problems. If I use htmlentities or htmlspecialchars then TM symbols do not get written into the file, which are needed. On the other hand, if I don't use htmlentities, the TM symbols work, but the xml is not valid because & symbols are not converted. What can I do to make this work?
  20. Its because of the API I'm trying to access. They have the names encoded that way as a parameter. I've tested the urls, and the desired ones do work, whereas the others give "no info found".
  21. Hey guys, I'm having some problems trying to convert stuff to access an external api. The site I'm using has access by querying with a title formatted as UTF-8, however I can't seem to get the right results in php. I have been messing around all day, and have made no progress basically. What I have so far, is urlencode(utf8_encode($game)) This half works, but not fully What I'm trying to get it this As you can see, it works for some symbols, but not others. I've been searching, and according to the letter database, the desired does match up for what the UTF-8 codes should be, I'm just not getting them. I'm pulling the game names out of a mysql database, but I have also tried it as a constant, and still have the same problem. Can anyone give any suggestions asto why this is happening, or what might make it go right? Cheers Arkane
  22. Ok guys, here's the code I have atm. <?php $startnum = isset($_GET['startnum']) ? $_GET['startnum'] : '0001'; $endnum = $startnum + 99; $books = new SimpleXMLElement('NDS.xml', null, true); echo '<h2>'.sprintf('%04d', $startnum).' to '.sprintf('%04d', $endnum).'</h2><p>'.PHP_EOL; $titles = $books->xpath('games/game'); foreach($titles as $title) { $num = $title->releaseNumber; if (($num >= $startnum) && ($num <= $endnum)) { $romnum = sprintf('%04d', $num); $imgfile = 'imgs/0001-0250/'.$romnum.'.jpg'; echo '<img src="' . $imgfile . '">'; } } echo '</p>'; ?> Obviously, it doesnt work if the img number is higher than 250, and since it now goes up to 3000 I figure I need a script rather than just an if then else.
  23. Hey guys, Sorry if the topic is misleading, I couldn't think of an explanation for this. I'm trying to add images to my site automatically. It's using numbers and I already have the code for most of it. The problem is that the source images are kept in folders to seperate the files more. My script adds the links according to a 4 digit number, but each file is kept in subfolders, so 0001.png is in imgs/0001-0250/, with the folders always increasing in 250 increments. Can anyone help me for some script to calculate the number so that it can all be done automatically? Cheers guys
  24. I'll try test on another server if I can... see if I can figure anything out. Would be interested to know at least.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.