Jump to content

pwired

Members
  • Posts

    2,318
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by pwired

  1. Link1: You've been using MODX but now you've found ProcessWire. It’s totally amazed you and you can’t wait to get started. But…you are wondering where everything is. If this is you, read on… http://processwire.c...ning-from-modx/ Link2: A MODX refugee: questions on features of ProcessWire http://processwire.c...of-processwire/ Link3: Code comparison between modx and processwire. http://processwire.c...ge-2#entry30349
  2. Nice found arjen, very good example too of the flexibility of processwire.
  3. Thanks for mentioning that Teppo. I looked at the code of wirecopy and found that the code: function wireCopy($src, $dst, $recursive = true) { if(substr($src, -1) != '/') $src .= '/'; if(substr($dst, -1) != '/') $dst .= '/'; $dir = opendir($src); if(!$dir) return false; if(!wireMkdir($dst)) return false; while(false !== ($file = readdir($dir))) { if($file == '.' || $file == '..') continue; if($recursive && is_dir($src . $file)) { wireCopyFiles($src . $file, $dst . $file); } else { copy($src . $file, $dst . $file); $chmodFile = wire('config')->chmodFile; if($chmodFile) chmod($dst . $file, octdec($chmodFile)); } } closedir($dir); return true; } looks very similar with what you find on google about copying a dir with php, like this code: copy_directory('/directory1','/public/directory1') function copy_directory($src,$dst) { $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { recurse_copy($src . '/' . $file,$dst . '/' . $file); } else { copy($src . '/' . $file,$dst . '/' . $file); } } } closedir($dir); } So for the moment I let wirecopy() be a part of processwire and concentrate on creating my own php scripts as I still need to learn a lot about php. I like to have a bunch of php scripts sitting there on my hosting server, that I can run directly from my browser. Fascinating all the things you can do with php. But of course if I could make a Tab or module somewhere in processwire, so that I can copy dirs directly from there, that would be even more cool !!
  4. With this link http://processwire.com/apigen/ I found something about wire but nothing about wirecopy() that was mentioned by Soma.
  5. Coda is for mac os, - - - looking for os independent php script, e.g. see above, or browser app. Also duplicate folder with ftp first download folder to temp and then second re-upload the folder to the server (like winscp for windows) which is actually a waist of time and bandwidth in case of big folders. A script running on the server will copy directly on the server and will be much faster.
  6. Oops - sorry - missed that completely !! Was so focused on php code - pclzip.lib.php - pear - etc. etc. Will have to look in that tomorrow, it's already deep in the night here. Time is always against us. Already am curious what code or class is behind wirecopy. Thing is - there is no ftp client that supports copying folders on the server, has something to do with the ftp protocol. Strangely enough there are ftp clients that support moving folders on the server. I think copying folders on a server is possible with the pear tar_archive class If anyone knows a way how to (fast) copying folders on a hosting server, e.g. copying folders around in htdocs, - but not using shell - telnet - ssh - or php system - - - please let me know.
  7. Ok, how do you extract a tar.gz file on an on-line server, e.g. filename.tar.gz without using CPanel ? My hoster does NOT provide shell access and PHP is executed in safe mode. And this code does NOT work either: < ? system(\"tar -xvfz filename.tar.gz\"); ?> PHP Scripts working with pclzip.lip.php do not work either with .tar.gz (error: can not find end of archive!) these scripts only work with zip files packed with 7zip or winrar. Yes I could dump my hoster and look for one who gives shell access, but for the moment I think it would work with the Pear class Archive_Tar What would be a php test script to check if Pear is enabled on a server and php code that calls the Archive_Tar class to extract filename.tar.gz ? Anyone ?
  8. wireCopy() didn't show up anywhere with google, nor did it show up in the php file function list - so long for wireCopy() on a sunday afternoon Anyway this newbie php found works too: <?php recurse_copy("/root/path/htdocs/wire","/root/path/htdocs/backup/wire"); echo "copying is done"; function recurse_copy($src,$dst) { $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { recurse_copy($src . '/' . $file,$dst . '/' . $file); } else { copy($src . '/' . $file,$dst . '/' . $file); } } } closedir($dir); return true; } ?> Is that return true; safe to do for clean up ? Enuf coding, time for cold beer + sofa + tv
  9. Thanks Soma, going to try wire copy asap! In the mean time a php newbie like me found this after digging with google and I tested it, and it is working ! This is much more fun than using CPanel ! <?php /** * /root/path/source/directory/htdocs/wire * * /root/path/destination/directory/htdocs/backup/wire * */ copyr("/root/path/source/directory/htdocs/wire","/root/path/destination/directory/htdocs/backup/wire"); echo "copying is done"; function copyr($source, $dest){ // Simple copy for a file if (is_file($source)) { $c = copy($source, $dest); chmod($dest, 0777); return $c; } // Make destination directory if (!is_dir($dest)) { $oldumask = umask(0); mkdir($dest, 0777); umask($oldumask); } // Loop through the folder $dir = dir($source); while (false !== $entry = $dir->read()) { // Skip pointers if ($entry == "." || $entry == "..") { continue; } // Deep copy directories if ($dest !== "$source/$entry") { copyr("$source/$entry", "$dest/$entry"); } } // Clean up $dir->close(); return true; } ?> This code is not mine of course I found it on the net and managed to get my source and destination dirs right I guess it is no problem to use this code in private use. Anyway this must look something very simple for you pro coders but for me php is still like chinese What I also noticed: I can't get this php code to work when I want to copy to a dir above the htdocs folder, but I CAN do this with ftp. Somehow my hoster has blocked it for php but not for ftp CPanel stays unbeatable when it comes to deleting a folder with many files in it. With CPanel I can delete a huge folder in seconds, while deleting that same folder with ftp can take half an hour !! But running your own php scripts in htdocs is much more fun, so next try is going to dig a php script to delete a folder Now gonna try Soma's WireCopy
  10. Thanks Josh, tried WinSCP but it is downloading to a temp first and then upload it back to the server If there is nothing else then ok will use Cpanel but that is not fun at all. I guess there must be a nice php copy folder script somewhere that you can run directly on the server ?
  11. How do you copy files and folders on the server with FTP ? 1. Downloading and then re-uploading is not an option 2. Some FTP clients let you do "move" a file or folder on the server but none of them let you do "copy" (why is that anyway ?) Ok, copying files and folders on the server can be done inside cpanel but this is very tedious, lot's of mouse clicks and lot's of going up and down folder paths. Does anyone know a FTP client with "copy" option for files and folders on the server ? If not ftp, is there any other tool that can do this job ?
  12. Thanks Ryan, making these issues more clear to think about for better webdesign.
  13. Yes it was designed this way for good reason.
  14. Nice one. Added to my code snippets.
  15. Success is just one click away
  16. There are loads of them on google. Just one example: http://bxslider.com/ Also see how to implement code + examples + faq down the page.
  17. Thanks for stepping in on this Ryan. All the hours I spent looking for Tinymce's code blocks and formats, we'll I can still use that knowledge to change the toolbar of Tinymce. That is handy to know because experienced clients ask for an extended Tinymce toolbar. Yes those things are very true and we should not learn them in time the hard way with our clients, but keep our focus on it from the beginning when designing the website. Sometimes we lose focus and "fix" something quick and dirty with the help of the html source editor of tinymce. Bad habit. I think using a css framework also helps to keep design clean and portable like I am playing now with simplegrid but that's another story. Coming back to the subject, where clients want to edit their own text in their website. What about clients editing things in their text like : 1. font type 2. font size 3. font color 4. text line background color 5. text block color. Those edits I think should be done by the client himself in Tinymce, right ? Or should that also be part of the webdesign ? Should clients call and pay you for editing one of those 5 edits ? If that is so then all that is left for a client is pure text and nothing else. Isn't that just too limited for a client ? Would it really hurt portability and semantic there ? Which reminds me that there is also a discussion going on about markdown and textile http://processwire.com/talk/topic/2303-markdown-textile/#entry49298 Is it really true that markdown and textile are better for a client instead of tinymce ?? I remember from the old modx evo days you could go inside the modx evo configuration file of tinymce and change it into a plain text / html editor but I don't know where to configure that in processwire.
  18. http://www.elated.com/articles/textile-markdown-nice-alternatives-to-wysiwyg-editors/
  19. Nice example of html building with php/api. I don't have that coding level yet. I have to visualize the end html structure first and then break it apart with php/api like you are doing so easily. But already can see the possibilities.
  20. Still haven't simplegrid working the way I want, gonna be late again, but the music is gonna be ok. Yeah
  21. Talking about viewport, I found this line in simplegrid css: <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> and this about mobile firefox https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag
  22. Still remember this one ? Nice one from 2003 bumped on it again today on youtube and is still fueling my emotions from end 90's when wind of life was ok. Playing it while playing with pw. Feels good in both ways. Now listen to this one. Guess Blue Cantrell sampled from Dr. Dre in their song. Nice one too. https://www.youtube.com/watch?v=X_iuSoyvExo
  23. I knew it must have been something obvious but since It's my first timer with a css framework I didn't see it at first. Was expecting something complicated at it. Thanks guys, I can see now how beautifully pw already is prepared to take everything in with head.inc - home.php and foot.inc - as with so many things - working on it.
  24. Thanks for the reply diogo. I don't need the index.html from simplegrid css ? Inside index.html I see things like this: <div class="example-grids"> <h2>Basic 6-Column Grid Slots</h2> <p>Slots 0-5 represent the 6-column grid. These slots can be combined to create a 3-column grid too.</p> <div class="row"> <div class="slot-0"> <p> .slot-0 </p> </div> <div class="slot-1"> <p> .slot-1 </p> </div> <div class="slot-2"> <p> .slot-2 </p> </div> etc. etc. etc. Where would I place these div's inside processwire to make it look the same as how index.html looks in my browser ? Would it be inside head.inc and foot.inc ? The calls for the simplegrid css needs to be done somewhere in processwire too: <link rel="stylesheet" href="./css/720_grid.css" type="text/css" media="screen and (min-width: 720px)"> <link rel="stylesheet" href="./css/986_grid.css" type="text/css" media="screen and (min-width: 986px)"> <link rel="stylesheet" href="./css/1236_grid.css" media="screen and (min-width: 1236px)" > I guess this will be done then also in head.inc ?? For starters I would like to make my processwire website look exactly the same as how the index.html file of simplegrid looks in a browser. That would help somebody like me who never used a css framework, to understand how to use simplegrid in processwire. Thanks.
×
×
  • Create New...