-
Posts
4,085 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
@bytesources: thanks for the help. Now you let me alone with two questions: Why does the $config->urls->root output "/processwire/" ? Looking to the full pathes, it should be only "/". But looking into your provided .htaccess file at the ProCache section it clearly shows that the urls->root should be "/processwire/". But then all the full pathes should be look like this: /home/my_home/Programs/rubystack-2.0.0-12/apps/processwire/htdocs/processwire/{index.php} This is confusing, or I am wrong? How do you call the homepage in the browser? http://localhost/ or http://localhost/processwire/ ?
-
Best way to implement a global utility function?
horst replied to jordanlev's topic in Getting Started
+1 -
Best way to implement a global utility function?
horst replied to jordanlev's topic in Getting Started
when it is in the site/config.php it is available everywhere, also in modules, regardless at which time a module is loaded. (I'm speaking of custom modules, especially created just for one site) I can use all my personal utilities in those modules, in templates, in hanna-codes, just every where at every time, - thanks to Ryan who made $config populated first in PW. (so easy and with less writing) -
@bytesource: obviously there is some (more) confusion working (and I was to try to clear them out, -ts,ts) What I want you to do is NOT to edit your .htaccess, but just to answer my post and write "into your post here in the forum" the full pathes for those. To avoid displaying sensible data here in the forums I want you to use an alias for your servers docroot. But as you are working on a local machine, we make this now obsolete. Please can you write for me the "full pathes" (where it is stored on your disc! nothing within PHP or PW, just the plain pathes from your HD) of the following files: PWs index.php PWs .htaccess your site/config.php the responsive-images.php
-
On the modules site of AutoUpgrade is to read under Compatibility: 2.1 and 2.2 In ModulesManager it is signed as ALPHA state, not Beta or Stable, but ALPHA! So, don't know if it is actually already in, because I used an old version of ModulesManager to check what it displays, it would be good to see the compatibility numbers or those with only lesser version numbers then the actually used PW version should be not listed, maybe.
-
any associative array as: json serialized array or still as php array ??
-
Best practices for creating fields/templates in a module
horst replied to gRegor's topic in Module/Plugin Development
Sounds good, both alternatives. I think it depends on what you want to do with the module to choose the one and not the other. And according to this there pops up a question: How will you handle the created fields and templates by uninstalling the module? Do you want to remove all pages created through the module and the templates and the fields, or do leave it there? -
nice to know, but at uberspace there is no need to work around not writeable wire folders: As I understand this, PHP can write to all your own directories, but every one cannot. So, uberspace is not a "cheap" shared hosting, technically. PHP only needs 0755 here, whereas on many other (cheap) shared hosts it would need 0777 what should be avoided.
-
@adrian: good call!
-
@bytesource: please can you fill in the following gaps? add the fullpath for all requested files or directories here, but for the not web accessible part use the alias "docroot". So your webroot will be written: docroot/ - where is your processwire index.php: docroot/ - path to the Processwire .htaccess file: docroot/ - path to the site/config.php: docroot/ - where is the responsive-images.php: docroot/ Cheers, Horst
-
Hi @formulate, welcome to the forums! If I understand right, you first create csv-files from the iso-8859-1 site, then you import them into PW with the csv-importer module? Why not simply convert the whole iso-files to utf-8 files before using them for the import? ------------------ There is a case study from a (lets call it 'more customized') import scenario with a W**dPr*ss site. I have done something similar with a DB from another system (Gallery2). Maybe this is of interest for you? If you do know the DB structure of the old system good enough, so that you can query the right things in the right order, you may be able to setup a single script that does the whole import in greater chunks. Importer scripts are easy but powerfull. If you are interested we can point you to other examples or assist in building yours (if you know enough of the old system structure and how to query it).
-
@adrian: the context of that FTP transfer is _only_ for shared hosting environments where you are not in the comfortable situation to have wire folder write access without setting it to write for all (0777). But I don't know of any shared hosting environments that does _not_ have FTP enabled. But I do know of many that also do not have SFTP / SCP or SSH. Some may have FTPES. So, FTP is already enabled on those Servers, why not using it for transferring from local file system to local FTP? I cannot see any downside here. If you have your own server or are not in (cheap) shared hosting, you always can use other ways I believe. Maybe @NorbertH has quoted a to small piece of Ryans statement, so that it got a bit out of context?
-
I have got it from your provided htaccess file somwhere around Line 220, conditions for ProCache.
-
Best way to implement a global utility function?
horst replied to jordanlev's topic in Getting Started
I use my own utility function files in my site-profiles in a subfolder called for example: 'mylibs' I include them once in the site/config.php file: include_once(dirname(__FILE__) . "/mylibs/myfunctions.php"); This way I can use all what is in my utility files every where, regardless if I run PW in the webserver or if I bootstrap it for CLI operations. -
You mean I should use double-quotes for better readability? You are right! I will try to do so. (but may be hard for me, )
-
@bytesource: does this match like Oliver said? RewriteRule .* responsive-images.php?swidth=%4&pwidth=%5&pxratio=%6 [QSA,L] or should be better something like: RewriteRule .* %{DOCUMENT_ROOT}/processwire/responsive-images.php?swidth=%4&pwidth=%5&pxratio=%6 [QSA,L]
-
To avoid those if isset etc. you can list all your variables that you use in some templates initially in the _init.inc or what ever you use that is loaded before all others. (At least, you also could do it in the site/config.php, but I wouldn't) _init.php: $sorted = ''; // if it is for Output, I use an empty string initially $variable1 = ''; $variable2 = ''; $variable3 = '';
-
@NorbertH: Yes, this shouldn't matter in this case because WellKnown-OpenSource-Files are transferred from local filesystem to local FTP server only.
-
a brave or lion-hearted but very eclectic version can be made out of this: http://upload.wikimedia.org/wikipedia/commons/a/af/House_sparrow_chick.jpg
-
Please, based on a version of Reno, - and could it be that way that the advanced features are only but automatically displayed for superusers? So editors or others can use the theme, but without the advanced features.
-
I also don't know the code of the blog module from Kongondo. What I have understand is, that you have some pages belonging to template blog_category. I don't know if dogs, cats, fish, birds are the names of those pages or the titles, so please check and if they are the titles, please correct it in the find selector for the categories <?php // the names (not the titles) of your categories you want to output in the recent list for $categories = array('dogs', 'cats', 'birds'); foreach($categories as $category) { // find the category page and echo the title, [if it not has the template 'blog-category', please change here] echo "<h2>" . $pages->get("template=blog-category, name={$category}")->title . "</h2>"; // find the (limit) latest posts of category=$category, - if there are any, display title as link and a brief summary $latestposts = $pages->find("template=post, category={$category}, sort=-created, limit=2"; // if the above doesn't work, you may try this, if category is a pagefield in the post-page //$latestposts = $pages->find("template=post, category.title={$category}, sort=-created, limit=2"; if($latestposts) { foreach($latestposts as $latestpost) { echo "<h3><a href='{$latestpost->url}'>{$latestpost->title}</a></h3><p>{$latestpost->summary}</p>"; } } } ?> Jan Romero has shown you the right way already, but your code-fragments and your explanation of what you are after are not very clear, at least for people who haven't worked with Kongodos blogmodule. So if it doesn't work, please come back and explain a bit more exact what you have done, which part works and which not.
-
Show entire page tree as a dropdown under PAGES in Admin?
horst replied to Thomas108's topic in Getting Started
Ah, ok. No it will not change in behavior. And no, I don't know of any tool that does that. I'm not sure, but I think no, there also isn't what you are asking for, but you may have a look to the admin themes section by yourself. -
Show entire page tree as a dropdown under PAGES in Admin?
horst replied to Thomas108's topic in Getting Started
with the new PW 2.5 (what will be released very soon, or you can get in the dev-branch on GitHub) you can use Tree and Find. Do you know Find? -
I think this is sort of a syntax error: default: ; break; You need to add something between default: and ; Or you let it out if you do not want to specify a default! switch($sort) { case 'asc': $sort = "name"; break; case 'desc': $sort = "-name"; break; } http://php.net/manual/en/control-structures.switch.php