Jump to content

bullchina

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by bullchina

  1. I have a mysql database that people will be updating frequently by exporting a database from access using the mysql2access script, and importing the data via the phpMyAdmin import page. I was wondering if there might be a way to consolidate this whole process into a simple icon on a windows desktop that a user could double click, or something similar. Right now my instructions call for too many clicks and logins, and I figured there might be a way to make the whole process faster. Thanks for the help, dave
  2. http://www.roldanberengue.com/?p=project&id=10 the last two images have accent characters in the filename, and for some reason they won't display in internet explorer, but they display fine in firefox. i tried doing an htmlentities function on each of the paths in php, and it didn't change anything... i'm really unexperienced with all this character encoding stuff, and I can't seem to find a solution, thanks for the help, dave
  3. ok, i found something called finfo_open(FILEINFO_MIME); which is supposed to give back the mime type (i forgot that word...). i guess you have to have a pear fileinfo module installed to get that to work. also, i found that the filesize function will not work with absolute http url's. it must be a local file. then i saw that readfile() will return the number of bytes of any file, but that seems a little inefficient. I think it's a better idea for me to store the local path to the file relative to the site root in the database, and then appen the doc_root upon outputting the rss... is that right, or is there a better way?
  4. I am creating a small script to output news info from a database into rss format, and I want the ability to include enclosures, but I want it to be as easy as possible for any person to update the database. the enclosure item in an rss feed requires a url, the length in bytes of the file, and the filetype. I am using the filesize() function to get the bytes, so the user doesn't have to input that element into the database, but is there a more automated way of adding the file type attribute, without creating a huge switch statement? I can't seem to find anything about this, but I also don't really know what terms to search for. I suppose the switch statement won't be that big, but I thought there may be a better way to automate this process. Thanks for your help, dave
  5. i figured it out from a tutorial on kirupa.com ... i wasn't giving a content-type header in the php code. hope this might help someone else some day also: kirupa.com/web/mysql_xml_php.htm
  6. I have a database with news entries in it in mysql, i'm grabbing the data, and then trying to output that data as a valid rss feed, but the feed just shows up as text in the browser. i must be missing something, but when i view the source code, it looks identical to every other rss feed i've ever seen. the code to generate the rss is in a smarty tpl file": [code]<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" >   <channel>     <title>Roldan + Berengue, arqts.</title>     <link>http://www.roldanberengue.com/</link>     <description>News from the office of Miguel Roldan and Merce Berengue</description>     <language>en-us</language>     <pubDate>{$news[0].date}</pubDate>     <docs>http://blogs.law.harvard.edu/tech/rss</docs>     <managingEditor>dvmorris@gmail.com</managingEditor>     <webMaster>dvmorris@gmail.com</webMaster> <image> <url>http://arquitectes.coac.net/images/rss.jpg</url> <title>Roldan + Berengue, arqts.</title> <link>http://www.roldanberengue.com/</link> </image> {foreach from=$news item=item key=key}     <item>       <title>{$item.title}</title>       <link>{$item.hyperlink}</link>       <description>{$item.description}</description>       <pubDate>{$item.date}</pubDate>   {if $item.enclosure != ""}   <enclosure url="{$item.enclosure}" length="{$item.bytes}" type="{$item.type}" />   {/if}     </item> {/foreach}   </channel> </rss>[/code] but it shows up like this: http://dave.showviz.net/rbweb/news/rss/ no clue what's wrong, but i know it's something simple. thanks for your help, dave
  7. i went ahead and tried selecting "latin1" in the mysql import dialog, and the accent characters display fine. weird. i hope that's a real solution. thanks for your help.
  8. i have a database that i am creating in access, and lots of entries have accent characters. every time i want to update the web version of the database, i export the access to mysql, with a script from mysql.com called access2mysql.txt or something like that. anyways, the characters come up as question marks or something weird in phpMyAdmin, and i have no clue what to change to get it to work properly. i assume it's something to do with character encoding, but i haven't found anything concrete that fits this same situation. i'm kind of a newbie to all this database stuff, thanks for the help,
  9. I realize photoshop save for web strips iptc data, but i read somewhere that imageready's "save optimized as..." does keep the iptc data, etc... i have this script that runs through a directory, and stores the title , description, and copyright info from iptc tags in each jpg in the folder, and it works for images saved with save as... in photoshop, but not for images saved in imageready's save optimized as... [code]<?php if (isset($dir)){ $images = array(); $imagecount = 0; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if (substr( $file, count($file)-5,4) == ".jpg"){ //set paths to image and thumbnail $images[$imagecount]["path"] = $dir.$file; $images[$imagecount]["thumb"] = $dir."thumbnails/".$file; //grab iptc data $size = getimagesize ( $dir . $file, $info);      if(is_array($info)) { $iptc = iptcparse($info["APP13"]); foreach (array_keys($iptc) as $s) {            $c = count ($iptc[$s]); for ($i=0; $i <$c; $i++){ if ($s == "2#120") $images[$imagecount]["description"] = $iptc[$s][$i]; if ($s == "2#005") $images[$imagecount]["title"] = $iptc[$s][$i]; if ($s == "2#116") $images[$imagecount]["copyright"] = $iptc[$s][$i]; } }                } $imagecount++; }        }//end while loop for directory closedir($dh); } } } ?>[/code] it really drove me crazy, until i just decided to use save as in photoshop, and forget about imageready, unless someone knows how to fix it, or what is actually wrong. the error i got said something to the effect of: [code]must supply an array type for the first argument of array_keys() function. [/code] to me that means imageready stores the metadata in a different way than photoshop, but anyways, i tried this code: [code]<?php function output_iptc_data( $image_path ) {    $size = getimagesize ( $image_path, $info);          if(is_array($info)) {        $iptc = iptcparse($info["APP13"]);       foreach (array_keys($iptc) as $s) {                      $c = count ($iptc[$s]);           for ($i=0; $i <$c; $i++)           {               echo $s.' = '.$iptc[$s][$i].'<br>';           }       }                  }          } output_iptc_data("bcnactiva/1.jpg"); ?>[/code] with the imageready images, and it worked... weird... thanks for any help that can be provided...
  10. oh i wasn't looking to get into web based submissions of images, this is pretty much a static site where a database will be kept locally in access at the office, and then convert it to mysql or xml when it's changed, and then just copy the files over to the server. i was just wondering if it's really necessary for me to make a table in the database to store the image names/titles/descriptions, etc...
  11. i want to store info about a project in a database, and each project can have multiple images associated with it. at first i started to create a relational table for the images, but i was thinking that it might be easier to just store the image title and description info in the exif/iptc tags, and then just run a small php script that runs through the unique project directory where the images are stored, reads the list, and outputs the images with the exif info. i noticed that save for web in photoshop strips out all the exif info, etc... and images saved with save as... are larger. which method is better? the database approach or just storing images in a folder with exif/iptc data? thanks for the help
  12. yeah, well it's becaue i'm not sure what server it's going to go on, but i know it will have php, and i know i can get it to work with xml, but i don't know much else about databases. i see your point about the one to many thing, that makes sense. each image will be used only once, and each project will have a folder where the images and files will be stored, adn the relative location of those folders will be stored as a string in the projects table. i guess all i need now is to figure out how to connect to the database in php and all that, and i'm sure there are plenty of tutorials out there. thanks for your help, dave
  13. I have an xml structure that I want to use in a web page with php that looks like this: [code]<projects>         <project>                 <name> ! Test Project </name>                 <projectdate></projectdate>                 <constructiondate> 2006 </constructiondate>                 <location> Barcelona, Spain </location>                 <description>                         <![CDATA[ <p>This is a test project description with two paragraphs</p><p>this is the second paragraph</p>           ]]>                 </description>                 <type>buildnigGarden</type>                 <team></team>                 <budget></budget>                 <area></area>                 <client></client>                 <info> this is a field for extra information, about the clients, the size, price,                         etc... </info>                 <directory> test </directory>                 <images>                         <image name="test.porch.jpg" title="this is image 1."/>                         <image name="test.firstfloor.jpg" title="this is image 2."/>                         <image name="test.firstfloor2.jpg" title="this is image 2."/>                 </images>                 <files>                         <file/>                         <file/>                 </files>                 <status> built </status>         </project> </projects>[/code] and i have to store this same information structure in a microsoft access database. i have no idea how to get a list of images or a list of files into an access database, and i'm wondering if i'm way off track with this. i want to end up with a full access database storing all of these projects, where each project can have a number of images and files associated with it, and i need to be able to convert it to xml for storage and retrieval on a web server, to display the contents in a php web page. do i have to use relational tables to do this? if so, is it easy to output all this to xml? thanks for the help, dave
  14. so I will need to learn xPath as well? How long do you think all of this will take to absorb and get up and running? thanks for your help, i really appreciate it...
  15. well i have this xml code: [code]<?xml version="1.0" encoding="ISO-8859-1"?> <projects> <project> <name>Test Project</name> <date>2006</date> <location>Barcelona, Spain</location> <description><![CDATA[<p>This is a test project description with two paragraphs</p><p>this is the second paragraph</p> ]]></description> <type>Corporate Garden</type> <info>this is a field for extra information, about the clients, the size, price, etc...</info> <directory>test</directory> <images> <image name="test.porch.jpg" title="this is image 1." /> <image name="test.firstfloor.jpg" title="this is image 2." /> <image name="test.firstfloor2.jpg" title="this is image 2." /> </images> <files> <file /> <file /> </files> <status>built</status> </project> </projects>[/code] and i want to be able to display the projects (there will be a lot of them) sorted by different parameters, like by type, by date, by location, and also be able to print out image thumbnails, hyperlinks to the big images, etc... I also know very little about XSL, and i wouldn't even know where to start. I'm just learning smarty, and i have the whole rest of the site working in smarty.
  16. I tried posting this two days ago, but it never got answered... I just want to learn how to parse xml that has more than three levels of depth in php, and display the results, sorted, in a smarty template. thanks for any advice you have to offer
  17. this site: http://dave.showviz.net/bet2/ has a header image with a red line under the text that is part of the image, and then a div sitting behind it that has a css border property to continue the 1px red line to the extents of the page. however, in firefox on linux, the line doesn't match up, firefox on mac i got it to work, but if you change the font size, by hitting ctrl + or -, or however you do it, the image moves up and down. The design should look like this: http://dave.showviz.net/bet/19.jpg and I can't decide what the best way to do it: as an extremely wide jpg with the red line and the text in it, with the text as actual text in the html, or how i have it now with a tweak in the css file so the image won't shift around. any help would be great, thanks, dave
  18. I tried out this tutorial: http://www.cwhnetworks.com/forums/index.php?showtopic=3004 and i used all the code they provided, with a few modifcations, and it doesn't seem to work properly. it seems that when i click a language button, it doesn't change the language until the page is refreshed or reloaded one more time. my code looks like this: [code]if (isset($_GET['lang'])) {     $lang = $_GET['lang'];     setcookie("language", "$lang", time()+36000); } //check cookie, if not set, default language is english if (isset($_COOKIE['language']) || $cookieflag) {     $lang = $_COOKIE['language'];     } else {     $lang = "en";     } $cookieflag=false; //now call all the pages according to the language, default case is english switch ($lang) {     case "en": require_once('includes/en.php');     break;     case "es": require_once('includes/es.php');     break;     case "ca":  require_once('includes/ca.php');     break; default: require_once('includes/en.php'); break; } [/code] is the problem that the cookie is not set that quickly that you can just immediately check if it is set, right after setting it? i have no clue, thanks for the help... the link to the site is here, but it's not done yet: http://dave.showviz.net/bet2
  19. I'm just starting a website that has to be in three languages, and  i decided to try out smarty templates. I have read some tutorials on how to do language switching, and it all seems to make sense, except the part about ensuring that if a user is on a certain page, and they switch languages, they will go back to that same page... If I am passing a ?lang=en variable in the get string to determine the language, but I am also passing get string variables to determine what content goes into the page, how do I make sure that lang=en and say, pageid=587 both get passed, for example.  do i have to do something like: [code]<a href="<? echo $_SERVER['DOCUMENT_ROOT']."?lang=en"; ?>" >switch to english</a>[/code] in the above example, what if the server[doc_root] variable already has lang=en in the string? then each time it would be adding "lang=en" to the string, and that seems wrong... i think the examples i've seen are just too simple to explain that, or maybe i'm still a little confused. the page is for an architect, and i'd like to store all the projects in three xml files, one for english, one for spanish, and one for catalan, and then use php to read the xml, sort it, display it however the user wants it displayed (by location, by type, by date, etc...), but i don't want to get too ahead of myself before I really understand how language switching works. thanks for the help, dave
×
×
  • 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.