Jump to content

desbest

Members
  • Posts

    117
  • Joined

  • Last visited

Everything posted by desbest

  1. Here is my code. <?php $options = $fieldtypes->get('FieldtypeOptions')->getOptions('trader_type'); print_r($user->trader_type); echo "<hr>"; if (in_array("1", $user->trader_type)) { echo "found!"; } ?> Below is what is printed on the page from the print_r() However the in_array() feature does not appear to be working, when I can see from what is on the screen, that it should echo "found!" as the number 1 is in the array as a value. What is going on and how do I fix it?
  2. How do I get the value of a checkbox POST data? Here is my code. <?php if($input->post->changesettings) { // $report->of(false); echo "<h1>deactivated is: <u>".$input->post->deactivated."</u>!</h1>"; $user->first_name = $input->post->first_name; $user->deactivated = $input->post->deactivated; } ?> <form method="POST" action=""> <input type="text" style="width: 390px; height: 48px; font-size: 2em;" class="mediumtext required styleme" name="first_name" value="<?=$user['first_name'];?>"> <input type="checkbox" name="deactivated" value="<?=$user['deactivated'];?>"> <input type="submit" name="changesettings" value="Change settings" class="bigbutton" /> </form> It gets the value of the "first_name" text box, but not the "deactivated" checkbox. What is going on? What am I doing wrong? When printing the deactivated in the h1 tag, it always shows 0 when checked and submitted.
  3. Is it just me, because when I have the Login/Register plugin installed and I try to register to the website on the front facing section, I don't receive a confirmation email. I have the WireMailSMTP plugin installed and setup correctly. I can receive password reset emails from the admin panel if I reset my password. However I don't receive any confirmation email if I register to my website using the form that the Login/Register plugin generates. Is this a bug or am I doing something wrong? Does it work for anyone else? Update I have made a fix for this. https://github.com/ryancramerdesign/LoginRegister/pull/4
  4. On my localhost computer, I created a new user using Login/Register and it said it emailed me a confirmation code. Is the module using the php mail() function to send the email, or SMTP? If it's using mail(), can you please change it to SMTP as PHP doesn't allow mail() emails to be routed through SMTP. If it's using SMTP, how do I change the SMTP settings?
  5. Is there a way to disable email validation on the Login/Register/Profile plugin when users register to the website from the frontend?
  6. Is it possible to login to a user (signup and logout) from the frontend? Has someone more experienced with Processwire than me, already made this functionality the proper way, or do I have to code it myself?
  7. Is it possible to add custom user properties to the user? Looking at the API Cheatsheet, the only properties for the user is id, name, email, pass and roles. Is it possible to add some new ones?
  8. I'm using this code to get a page's children <?php //$selector = "template=chapter"; $skyscrapers = $pages->find("$page->children"); foreach($skyscrapers as $skyscraper) { echo "<li><a href='$skyscraper->url'>$skyscraper->title</a></li>"; } ?> It works on one of my pages, but when I go to another one of my pages, I get the following error Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in C:\xampp\htdocs\rasarouting\wire\core\Selectors.php line 396) Both pages have children pages How do I fix this?
  9. I upgraded from wampserver 2.5 to 3.0.6 today, so when I imported my processwire database with phpmyadmin, I got this error. #1062 - Duplicate entry 'Modules.wire/modules/' for key 'PRIMARY' Does this mean I have something wrong with my database or can I continue using it?
  10. How do I make a button appear only where the arrow is? I searched google for head_button_clone and browsed the documentation and couldn't find anything. Also you'll see an [edit] link in my custom admin panel (above). Is there any way to change it to the type of edit/view/new, as the lister does below. I looked inside function ___buildListerTableColActions(Page $p, $value) { in ProcessPageLister.module and it doesn't appear that code can be copied to my admin page.
  11. Now how do I add these green links next to reported pages in my AdminCustomPage, where the reported page is mentioned with its name? I hate to ask noobish questions, but there is no documentation page I can go on, which will teach me how to do it.
  12. I'll break it down very simply. If I am working with CRUD (create, read, update, delete), then there should be a page somewhere documenting how to do it. For example, if a variable doesn't suffice to store information, there better be information on arrays, if arrays and variables aren't a sufficient means of storing information, there better be information on cookies, sessions and parsing xml, json and yaml, for the example of javascript and php. W3Schools and Tizag are popular because they teach people what method to make their information work with CRUD. Good documentation lets people know how to make information work with CRUD. When I want to do something in processwire as a newbie, I find it hard to find the exact documentation page which will teach me how to do it. I wanted to loop pages in a category. The https://processwire.com/api/selectors/ page didn't help me properly, as there is no example given with foreach so I copied that from the foreach Smashing Magazine article. I wanted to know how to create a module and arrange the admin page, and I couldn't find any pages to teach me how to do it, and I was thankfully told that I don't need to create a module as I can use AdminCustomPage. I was given a tutorial as a starting point. Now I want to create a button, but there are no pages on the internet to teach me how to create a button, but I was given sample code, but sample code isn't documentation. I sadly can't find any page on the internet that teaches me how to make a button in the admin page I've just created, and have that button do something. There is no function for me to lookup.
  13. Is there a way for me to add a button which deletes all the viewed reports? I wouldn't ask myself, but I'm a newbie and there isn't much documentation for AdminCustomPages.
  14. AdminCustomPages deserves its own website for being a versatile tool, and it deserves better documentation. The author says the documentation is on github, but when I look there, I don't see much documentation. There is no way that a processwire newbie would figure out how to add an admin panel page for reported content, without outside help, as the documentation is lacking.
  15. Thank you all for your help. It matters to me so much! With a few modifications and tweaks of AdminCustomPages, I can make it look more professional and match it to my needs. I like it how everyone's being helpful.
  16. As someone who has used php and ruby frameworks and has made a Magento plugin which is one of the hardest plugins to make, I do not find Processwire beginner friendly. I found... http://soma.urlich.ch/posts/create-a-helper-module-for-processwire/ http://www.flamingruby.com/blog/taking-apart-a-simple-textformatter-module/ http://designtutorial.website/extending-the-processwire-admin-using-custom-modules https://webdesign.tutsplus.com/tutorials/a-beginners-introduction-to-writing-modules-in-processwire--cms-26862 https://webdesign.tutsplus.com/tutorials/extending-the-processwire-admin-using-custom-modules--cms-26863 I've done that now and all that comes up is how to make X module, instead of here is all the Y's you need to make whatever module you have in mind. How to create a Hello World module, how to create a text formatter module, and one two of the tutorials found with google do not work, there is nothing about how to create the module I want to create. Part of reporting links (or pages) which I want my module to do, is to check the reported links in the admin panel for link rot, and delete the bad outdated links and once a report is viewed it becomes read. None of the tutorials I've made teach how to create custom admin panels. When I use a php framework such as Laravel, Symfony, CakePHP, FuelPHP, Fat Free Framework, Yii, Phalcon etc or even ruby Ramaze, when I check the documentation, all the tools I need to create a site is there, Controllers, Models, Views, Routing, Helpers, Sessions etc. However when I try to create a simple Processwire module, I cannot find a comprehensive place of all the tools or documentation I need to create a new module that has a page in the admin panel. I find it disappointing that when searching Google for "create processwire module" or "processwire module tutorial", that I am told how to make X module, without being given the information on how to create the module I want. Some parts are useful, such as how to define the module information or creating and dropping a database table upon installation and installation, but there is nothing much than that. Here's an example of an easy to understand documentation. http://ramaze.net/documentation/index.html https://web.archive.org/web/20120421091700/http://www.magentocommerce.com/knowledge-base/categories/category/development I do, as processwire doesn't have this functionality out of the box. I need a way to review reported links or pages in the admin panel, when someone clicks to report a link, a new report is created for me to review. I have to review these links or pages in the admin panel. The only way for me to have a page in the admin panel where I review all the reported pages (or links), is to create a module. Then what is the point of using processwire? Why do people use content management systems instead of handling all the pages as html files? Because it saves time. Why do people use Wordpress to make blogs instead of its competitor Textpattern or b2evolution? Because it saves time. As the maxim goes, don't reinvent the wheel. I don't believe in reinventing the wheel. If something saves time and works, then do it! If it takes much longer time to create a website in Processwire than it would in a php framework, then what is the point of using processwire??? I thought the pages, API and modules system would make it quicker to make sites than a php framework. If it takes longer then I cannot use it. Is there any comprehensive tutorial for how to make a processwire module, that doesn't tell me how to make X module, but instead gives me all the tools that teach me how to do it? What I'm asking is very simple. When someone clicks a link, a page is modified so a checkbox field is checked inside a page is checked. I then check all these checked pages in the admin panel, once seen it changes from unread to read, until there are no more unread. When seeing these checked pages, I can choose to delete the page or leave it as it is. So what have I learnt from the tutorials so far? How to define the metadata of a plugin and how to define what database table inserts and deletes happen when a plugin is installed and uninstalled.
  17. I am new to processwire and I want to have a processwire site where people click a link to report a page then I login to the admin panel and see all the pieces of content, or pages that were reported. Then I choose to delete the page or keep it up and class the report as "read" instead of unread so it's no longer on my system. However I don't see any good tutorials on how to create modules, and the module API is just a list of functions, so there's no way for me to know how to get started coding this. In fact I am trying to see if creating a site like this would be much quicker than using a framework like CodeIgniter, Laravel, Yii or CakePHP.
  18. If I learn twig I have to LEARN a new syntax but if I stick with php I use the syntax I am familiar with from making wordpress themes with their php templating language. I'm not a fan of people who try to make php shorter. Someone already tried to do that, then they scrapped the idea because it was a terrible idea. PHP will always be verbose. https://web.archive.org/web/20111202051225/http://getkirby.com/
  19. Below code does not work. <?php $page = $pages->get("/home"); foreach ($page->children as $child) { echo "<a href='{$child->url}'>{$child->title}</a>"; } ?> But when I change /home to a different page, it does work. Am I not allowed to show the child pages of /home ?
  20. I read them but they didn't help me as the example template php syntax did not help me with the type of site I want to create, though those pages are helpful to newbies like me. My site needs more php logic than presentation.
  21. It would be nice if the blog profile worked with processwire 3. Because it isn't, it's harder for newbies to learn how to template processwire.
  22. It works now. Thank you. It looks like the 2nd blog profile will have to do, as the 1st one doesn't work with v3 or v2.8. Also the 2nd blog profile has less features such as there being no tags or dedicated comments page, so it'll be harder for me to learn how to use processwire now, as I can't access those examples from the 1st blog profile. If the 2 blog profiles are outdated, should I refer to the documentation page to learn how to create templates?
×
×
  • Create New...