Jump to content

Search the Community

Showing results for tags 'php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Good morning, I'm working about a website made with Processwire, I don't know a lot about this CMS 'cause it's the first time I'm working with it. We have to change this website and when we try to use php in some template files (.php), it autocomment itself. Anyone has a solution about this, please? Thanks, Have a nice day
  2. I recently found while doing work on Laravel a nice tool called Var Dumpling that will convert all var_dumps to nicely formatted blocks of text with a structure, making it a lot easier do debug var_dumps. It's available on Chrome and Firerox, you can see what it looks like on their page http://vardumpling.com/ Hope some of you find it interesting!
  3. Today i found a new, at least for me, kind of PHP-framework, which does look very promising. It may be a bit off topic for processwire, but for all programmers here that were using a framework like symfony or laravel, it could be a very interesting alternative. The project is called Phalcon and here is what they are saying about it: I have not used it myself, but not only the perfomance does look promising (from two to four times faster than every other PHP-framework), also the framework is feature-rich. It does not make assumptions about directory-structure. Have a look and tell me what you pros here think about it.
  4. Hello, I'm trying to create some pages programatically, nearly 2000. they have many fields and the server crashes before complete saving them. There's a way to save this pages by small amounts? Thanks!
  5. Plase correct me if something is wrong, I'm still learning the processwire way xd. According to the API Docs http://processwire.com/api/variables/page/ $page->path The page's URL path from the homepage (i.e. /about/staff/ryan/) $page->url The page's URL path from the server's document root (may be the same as the $page->path) So I have to migrate a site from development to production server and all the links were messed up. Why? Because I was using $page->path for redirects. Changed redirects to $page->url and Presto! everything works fine. And, When to use $page->path? Use $page->path when importing other page. example $people = $pages->get('/system/people'); $friend = $pages->get($people->path . $input->urlSegment1); Use $page->url when you need a redirect $session->redirect($friend->url);
  6. Sorry for that messy topic title but my problem seems very complicated to describe in so few words. So here a better description of my issue: I have a many product detail site under a parent called /overview/. On this product detail site is at the footer a listing of all the others product detail sites including the site itself. (all children of the parent /overview/. So i have for example: /overview/test1/ /overview/test2/ /overview/test3/ /overview/test4/ /overview/test5/ My Code look like this at the moment: <?php $overview = $pages->get("/overview/"); $overviewchildren = $overview->children("limit=4"); foreach($overviewchildren as $overviewchild) {?> <a href="<?=$overviewchild->url?>"><?=$overviewchild->title?></a> <?}?> Now on the site /overview/test1/ the code list show test1, test2, test3, test4. But i want that the child on which the user is at the moment dont show up at the list. So for the site /overview/test2/ the list should show test1, test3, test4 and test5. I hope you understand my problem , cause im from germany and to describe a php issue in english is very hard for me. Thanks a lot everybody for helping me.
  7. Hi all, I'm currently making a web app using ProcessWire. It will be in Danish and I am having trouble making the date render out in Danish. Any suggestions? Thanks!
  8. Hello, I'm a newbie in processwire. I have a problem : In my file head.inc, in the sidebar, there is a link : <a href="http://www."><div class="sidebar-block sidebar-corps"><?=$txt['espaceCorps']?></div></a> I want to change the text of the link (the text behind the <?=$txt['espaceCorps']?>, but I don't find where I can change that in the admin site, or in the code.... Any idea ? Thanks.
  9. Hello, My code seems to become quite messy very quickly when I do something... For example : $taskId = $input->post->task[$checked_player]; if ( $taskId != 0) { // Task selected // Get the task bonuses $task = $pages->get($taskId)->title; $new_XP = $pages->get($taskId)->XP; $new_HP = $pages->get($taskId)->HP; $new_GC = $pages->get($taskId)->GC; // Do the math $player->XP = $player->XP + $new_XP; $player->HP = $player->HP + $new_HP; $player->GC = $player->GC + $new_GC; } I feel like I'm using to many 'bridges' variables (I'm not sure this is clear)... Do you think the following would be better? : if ( $input->post->task[$checked_player] != 0) { // Task selected // Get the task bonuses $task = $pages->get($input->post->task[$checked_player])->title; $new_XP = $pages->get($input->post->task[$checked_player])->XP; $new_HP = $pages->get($input->post->task[$checked_player])->HP; $new_GC = $pages->get($input->post->task[$checked_player])->GC; // Do the math $player->XP = $player->XP + $new_XP; $player->HP = $player->HP + $new_HP; $player->GC = $player->GC + $new_GC; } Or even (not tested) : if ( $input->post->task[$checked_player] != 0) { // Task selected $task = $pages->get($input->post->task[$checked_player])->title; // Do the math $player->XP = $player->XP + $pages->get($input->post->task[$checked_player])->XP; $player->HP = $player->HP + $pages->get($input->post->task[$checked_player])->HP; $player->GC = $player->GC + $pages->get($input->post->task[$checked_player])->GC; } Is it just personal preferences or does it have a performance issue to use variables ? It may sound like a 'noob' question, and I know it's not specific to ProcessWire, but I felt like asking, so I know better ;-) Thanks! PS : I've just noticed there was a 'dev forum' for such questions! It should go there... But I guess that's too late... Sorry!
  10. non coders get sick with stupid simple problems like when to use curly brackets and when not. Is it php syntax or processWire syntax? I found: http://processwire.com/talk/topic/2682-drop-down-select-to-search-form/?p=26224 "Curly brackets only necessary if you've got two "->" in there" but http://processwire.com/talk/topic/1627-newbie-question-on-template-tags/?p=14916 <li><a$class href='{$child->url}'>{$child->title}</a></li> only one "->" in there... and http://processwire.com/api/variables/pages/ $skyscrapers = $pages->get("/cities/chicago/")->find("floors>=60, sort=floors"); two "->"s but no curlies... two hours trying to find out and no result... this is what I want to do: if($section->knots) { echo "<tr>"; echo "<td><p>$pages->get('/FixedData/')->knotsLang:</p></td>"; echo "<td><p>{$section->knots}</p></td>"; echo "</tr>"; }
  11. Hi, Today I experienced a problem on my server, I could no longer create new files. The cause of this was the amount of files in the assets/sessions folder. The filesystem ran out of Inodes. My question is, shouldn't files in this folder be deleted automatically after some time? /Jasper
  12. Hi. I want to use the MixItUp script where I put the names category as filter. Basically, I need to achieve this: <script type="text/javascript"> $(function(){ $('#Grid').mixitup({ multiFilter: true, showOnLoad: 'category_1 category_2 category_3 category_4 category_5' }); }); </script> I use this code for getting the names category pages but, it adds an space at the first (generated by echo " " in order to separate the categories) that doesn't let to work correctly. <script type="text/javascript"> $(function(){ $('#Grid').mixitup({ multiFilter: true, showOnLoad: '<?php $categories = $pages->get("template=categories")->children("template=categories, sort=sort"); foreach($categories as $category){echo " ".$category->name;}?>' }); }); </script> With the above code I get this: <script type="text/javascript"> $(function(){ $('#Grid').mixitup({ multiFilter: true, showOnLoad: ' category_1 category_2 category_3 category_4 category_5' }); }); </script> Could somebody help me to avoid adding an space at the beginning of the first category? Thanks in advance Fernando
  13. I copies the Skyscrapers field entry data almost to the 'T' when creating my PW project. I created new pages/subpages for the drop down data to choose from and now I want to give a new page the option of selecting from one of those drop down of those categories. All looks good. I go from a drop down tree list of my pages, select the page I want to categorize the page with and then hit save ... but nothing stores in the database and when I come back I have to select it again. Also if I choose 'select' instead of PageListSelect I see a drop down containing nothing in the page when creating a new one. Is there some kind of programming needed to be able to store PageListSelect data? Thanks.
  14. I just started with PW and I've gotten the hang of things quite easily but whenever I make a new field it doesn't not appear on the user side of the template. I can manage the field content in the admin section but nothing appears but the title and body on the user side. Is there a permissions/roles function that I have to change? Is there something in the PHP template files I need to change? Thanks.
  15. Hi, I have a question about PW. For developing totally custom applications/extensions, maybe parse some data from other site or whatever, you should need to build new module. I reckon modules are extensions to PW. It is said that PW is CMF (Content management framework), that shows when you use it's API. But is it also any kind of framework for PHP, that comes in handy, when developing custom applications? Such as is Codeigniter or CakePHP? Or must be code written in pure PHP? Thanks. Best regards, Franci
  16. My site has several pages that require access to one-off scripts the rest of the site doesn't use. To keep pages loading as fast as possible we don't load these scripts on every page. Instead, we typically include them on a per-page basis in an extra block loaded after the footer html. When I first started trying to port to PW I added textarea fields for "extra_head" and "extra_footer" into my primary template, and I hoped I could include these script loading directives in the "extra_footer" block and be off to the races. In fact, this would have worked beautifully if I had hard-coded paths for these scripts. There's the rub, however! I was trying to do things the PW way, so I used the php directives to get the path to my site's "templates" folder. When I output this "extra_footer" field in the page, the php doesn't get executed, so I never get the script path, and the whole thing fails. <script src="<?php echo $config->urls->templates?>static/js/jquery.isotope.js"></script> I don't know if I have output the field in my template the wrong way, so maybe there's some other php or api call that will cause it to actually interpret the code in this field during output? Here's what I have used: <?php echo $page->extra_footer; ?> I had this problem in other places, too. For example, during the port of the site we decided to start out with a "body" textarea that we bulk-dropped the html markup from the previous site into. This html had references to images and other static resources that we tried to access with the same type of php path reference as in the example above. Of course, none of it worked because that php code never gets executed. Is there a way to have the php in fields get executed during the page production? If not, is there some other reasonable way to get the path to site resources like scripts and general-purpose images (that wouldn't usually be included in a page's "images" field? Thanks, Rick
  17. Chris

    learning php

    codecademy recently started an interactive php course for beginners. http://www.codecademy.com/en/tracks/php looks good so far. i was not sure if it fit's the "getting started" section of the forums, but maybe it's an interesting hint some people. maybe someone has links to add.
  18. Hi guys just moved from 34sp servers to lcn.com ones and as always something had to go wrong... transferred the db and files and linked up, everything worked until I tried logining in - I can't, no errors on the front end. I was also having trouble uploding images on some of my other sites So im guessing its a permissions issue just wondering what it might be, whether i just need to do something on .htacess or whether my hosting providerings can help. I hate sys admin Please any help would be great, Ben
  19. Hi there, for some reason I do not succeed in doing a simple iteration (in this case with images): <?php $number_of_images = count($pages->get(1012)->images); foreach($pages->get(1012)->images as $image) { $thumbnail = $image->size(118,112); echo "<a href='{$image->url}'><img class='photo' src='{$thumbnail->url}' alt='{$image->description}' /></a>"; if ($number_of_images % 3 == 0) { echo "<p>Insert</p>";} } ?> In this case, there a 5 images attached to 1012, if I echo $number_of_images inside the foreach loop it prints "5". But on the other hand this variable doesn't react on my "$number_of_images % 3 == 0", meaning that it does not insert the <p>...-Chunk every 3 images. Can you help me to find the error in my approach or code? Thanks in advance! marcus
  20. hi forum, in my current project i'll have a very long faq-list (ul, li). thinking on how i could improve the usability of this list, i had the idea to provide an entry box on top of the list: as the user types into it, the list narrows itself depending on which letters are typed (example: if "a" is entered the list is filtered and only list-items starting with letter "a" are presented). does anyone of you has ever made something similar or knows a good route how to implement it? i would appreciate any hint. thanks in advance, christoph
  21. Hi! I'm working on my first processwire project and everything is working ok, but i have a question stuck in mi head: which is the "best" way to organize functions and stuff on php/processwire (is my first php project too). I have something like this: -- functions.inc -- home.php -- foo.php -- bar.php functions.inc have all the "get" functions that pull out content of the database, like: function getHomeNews($posts){ $out = array; foreach($posts as $post){ $out["name"] = $post->title; } return $out; } then in my home.php template i put a "render" function and do the echo thing to show the html on the front end: function renderHomeNews($posts){ foreach($posts as $post){ $name = $post{name}; $out = "<h1>{$name}</h1>" } } $news = $pages->find("template=news"); echo renderHomeNews($news); Suddenly a question comes to my mind, what if i put all the "render functions" of the project on renders.inc and all the "getter functions" on getters.inc, so the code on the template could be smaller and all the functions will be on just two files. That makes sense? is the same stupid thing? How do you organize your projects? Thanks!
  22. Hi, I want to process images being uploaded to PW by a client. Basically, making a sepia version of the images (with manual settings). I'm wondering: where's the best place/moment to implement this kind of process? Do you have any suggestions? FYI: I'm also using the cropping image tool by Antti Peisa. Here's my code. It loads the image, filters it and then overwrites it. $image = imagecreatefromjpeg('myimage.jpg'); // the original file imagefilter($image, IMG_FILTER_GRAYSCALE); imagefilter($image, IMG_FILTER_COLORIZE, 19, 18, 0); imagefilter($image, IMG_FILTER_BRIGHTNESS, -10); imagefilter($image, IMG_FILTER_CONTRAST, -2); imagejpeg($image, 'myimage.jpg'); // overwrites the original file. Thanks!
  23. hello forum, i assume i'm overlooking something very obvious, but can't get it. i try to output markup depending on whether a page has been checked as "featured" or not: <?php $featurednews = $pages->find("featured=1, template=gmk-news, limit=2, sort=-date"); ?> <?php if (!empty($featurednews)): ?> output my markup ... <?php endif; ?> this outputs my markup even if no page exists with featured=1 (checkbox checked). in other words it returns !empty = true or empty = false although the array must be empty. sorry if this is a dumb question, still newbie with php ... thanks for your help.
  24. What's the process of making a Wordpress plugin work as a module? What do I need to translate and how?
  25. Inspired by Soma's Colorpicker module I'm trying to implement some custom styles for links, backgrounds etc. Martijn said it was possible to add a php file with css in it and echo out the variables in that. I've tried but can't seem to get it going. I've added a custom_styles.php file outside of templates because I believe you cannot have PHP scripts running in there and I've added <?php header("Content-type: text/css"); ?> to the top of the file as advised by Martijn but none of the variables are getting parsed. Has anyone got anything similar working. Currently I'm using Diogo's suggestion of inline styles in the head tags but it just feels a bit wrong (but it is working)
×
×
  • Create New...