Jump to content

manlio

Members
  • Posts

    148
  • Joined

  • Last visited

Everything posted by manlio

  1. Finally, thanks to various advices I found that for me the easiest way to accomplish this was to use MarkupLoadRSS module and retrieve the youtube ID from the link. I post here the code for future reference: $rss = $modules->get("MarkupLoadRSS"); $rss->load("https://url_to_my_feed"); foreach($rss as $item) { $url = $item->link; // link to youtube video provided by MarkupLoadRSS parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array ); //create a array with values contained in the URL $youtubeID= $my_array['v']; //$youtubeID is the youtube ID echo "<img src='http://i.ytimg.com/vi/".$youtubeID."/mqdefault.jpg' alt='".$item->title."'/>";// img url reconstruction }//foreach end
  2. Thank you Adrian, You guys are so awesome! I will give a look to simplepie. Merry Christmas and and all the best in 2015!
  3. Thanks Nico, the syntax is right, but the var seems empty and it doesn't show anything. (I tried also a var_dump and the result is null).
  4. Thanks for replies! This links is perfect! http://gdata.youtube.com/feeds/api/users/disney/uploads?orderby=updated&v=2&client=ytapi-youtube-rss-redirect&alt=rss But still I have a doubt. How can I access <media:thumbnail> through my php script Obviously, something like echo "<img src='".$item->media:thumbnail."'>"; will not work. Any ideas?
  5. Thanks owzim, I was tired and wasn't quite clear, sorry My problem is that I'm not able to see the node in the xml that identifies thumbnails and I don't know how to recall them. If I paste the feed in Firefox, it is able to retrieve thumbnails. To me seems that thumbnails are contained in the "description" node, but if I use that in my script no image appears, but only other text information. For testing purpouse you can try this feed (or any other youtube user) http://gdata.youtube.com/feeds/base/users/disney/uploads?orderby=updated&v=2&client=ytapi-youtube-rss-redirect&alt=rss This is the first time I deal with rss feed, so I apologize for my low skill. Thank you very much!
  6. Hi I'm trying to show a youtube rss feed in a frontend page. I have used the MarkupLoadRSS module. Everything works perfectly but I don't know how to retrieve video thumbnails. $rss->load("https://url_to_my_feed"); foreach($rss as $item) { echo "<p>"; echo "<a href='{$item->url}'>{$item->title}</a> "; /***Until this point everything works perfectly. The next line I just guessing with no success***/ echo "<img src='".$item->thumbnail."'>" I tried with the last line in several different ways with no success. I don't know how to exactly call thumbnails and what I have found didn't help me. Any help is really appreciated. Thank you!
  7. Ok I thought about that, but I didn't want to have two find queries for this purpouse and I believed I was missing the "wildcar". My php skill is really low so forgive me if I'm saying something obviously wrong. I would have to write two different queries like these, am I right? if (isset ($inputregion)) { $users->find("template=user,user_region=$inputregion,include=all"); } else { $users->find("template=user, user_region!='', include=all"); } Thanks
  8. Thank you owzim. I have learnt something more, but my case is a little different (sorry to be not enough clear). My $inputregion get single data from Url segment. So I have something like www.mysite.it/list/region1 www.mysite.it/list/region2 ecc... I would like to display users of all region using www.mysite.it/list/ Thanks
  9. Hi I have simple question that I'm not able to solve on my own I retrieve data with find like this $users->find("template=user,user_region=$inputregion,include=all"); Everything works when $inputregion is a single "region" but I would like to retrieve also all regions but I don't know how to set the correct value of $inputregion. I tried with something like $inputregion = "%" or $inputregion="/%/" with no luck. Thank you
  10. @blad Great "fucking awesome" video @Joss Yes it is really a blast from the past. I started with MX Kollection from interakt and was really hard to find something similar. But I agree that PW is really more powerful and flexible!
  11. I found ProcessWire by accident after searching for a lot of days a new way to develop website that worked for me. When I was giving up I read about this amazing cms/cmf in a comment of a thread. I come from Adobe Dreamweaver Developers Toolbox a project that was closed some years ago and I want to advice people to give a try to PW because it is really unique and very simple to use also from designer point of view. For sure you have to learn something but you will understand that everything is well thought and nothing is left to chance. PW is flexible, secure and very easy to learn The forum assistance is wonderful and very kind with novice user. I was never stuck and had to wait very little time before a useful and valuable response. IMHO one thing that PW miss is massive list of tutorial but I think it is only a matter of time and I hope to personally contribute soon in this respect. The forum is full of info but it is faster learning from tuts. Thank you Ryan (you are a genius) and thanks to all the people that make this possible. PW is wonderful!
  12. Thank you both now I understand better how to proceed. Thank you guys!
  13. Ok, thank you horst. In this case I could write the master and detail page in the same instructors page with some conditions to check if there is an URL segment. I'm right?
  14. After you help me to solve my previous problems, now I'm facing how to design a master detail approach for users. I'm still learning a lot of the basics so I'm sorry to bother you again. In a part of the website I had a structure like this home -courses --course1 --course2 --course3 and I had the page courses (master) that was based on a template "courses" from which I could go from a map marker field based directly to the children page (detail). Now I want to setup something similar but this time I'm dealing with users so they are in the admin->access->user. Now I have created a standard page instructors that should act as a master page and I would like to know which is the best way to deal with children. Should I create an instructors child page called instructor and than pass variables? I was thinking to use Url segements (to have something like mywebsite/instructors/instructor1 etc.. but I'm not sure If they are the right solution here and I have no experience with that). So many option and I'm not sure where to go. Could you point me to the right direction? Thank you in advance.
  15. Thank you very much to clarify and for the excellent support. Now everything is clearer and I prefer managing them as "normal" users. Regards
  16. This really sounds like a good thing, I'm feeling better. I was worried to have encountered a more serious problem. Hope that someone can confirm. Thanks for your time and precious advices marcus.
  17. Thank you marcus! This solved the first problem and now woks! While searching I noticed that user template can affect children and find behaviours so you have given me the key . Now can someone help me to understand why when I edit an instructor it change parent and moves to admin->access->user. I really want to avoid this. Thank you
  18. Hello! (PW version 2.5 after updating from dev branch) I have two different pages ("instructors" and "courses") with their children. I was trying to run a script like this $itm = $wire->pages->get("/instructors/"); $items = $itm->children(); foreach ($items as $item) { echo $item->title; } My problem is that it returns nothing (no errors - debug is on). The vardump($items) return an empty array. If I change to everything works fine and it returns the titles of the children. If I echo the first line I get the proper ID of "instructors".The main difference I can see between the pages is that instructors have the "user" system template. Is there any possible reason why I can't access these children? But here comes tha bad news (for me ). While trying to solve this problem I discovered that if I change data of an instructor and save, the instructor page "is moving" from the instructors parent to admin->access->user parent and this seems strange to me. But if I try to move it back I get an error that state that I don't have the permission to change the parent. I don't understand if anything is broken in the users or if I missed something, thanks for any help. Previously I found that there was one duplicate user (result of old test) under the admin->access->user page that maybe originate some problems. I deleted the user but the situation is like before. N.B. Instructors is the result of Import CSV Module and I would try to avoid to reimport them because there are other imported pages that are linked with a page reference to the PW id of the users, and new import will change that.
  19. Hi, can someone tell me how to copy some pages (and children) from one site to another? (obviously two processwire website) I wasn't able to find anything googling processwire website. Thank you!
  20. Wow, just found this by myself, but thank you for your excellent support!
  21. Thanks a lot to everybody! You all was really helpful. I think in one page I didn't set the pagereference and this cause the error (still not sure). But now thanks to your advice works perfectly. Great forum and PW rocks! Edit: Previously I setted the Page as "Single page (Page) or boolean false when none selected" instead of "Single page (Page) or empty page (NullPage) when none selected" and now works also if a page reference is blank
  22. Thank you adrian, unluckily this doesn't solve my problem. I need only one page and before I setted up the field as Single Page. I try to put back to multiple and use your syntax but still I get this error: Notice: Trying to get property of non-object in ...\site\templates\header.inc on line If I leave the field to Single Page and try to use echo $menu->pagereference->url; I get the same error.
  23. Im' building for exercise pourpose a simple menu system based on pages. Something like menu -menu1 -menu2 -menu3 I have build a menu template with a page field that I would like to use in the href attributes of menu link. Everything else works, but I don't know how to retrieve the url of the related page and not the ID. foreach($menus as $menu) { echo $menu->title echo $menu->pagereference; //this return the ID of the related page, but I would like to get the url ?> Something like this $menu->pagereference->url doesn't work so I don't know the syntax, I have tried different ways with no success. Thank you and sorry for the silly question. Regards
  24. Ok, thank you MadeMyDay and SiNNut, I will try to read more on the CSV importer and trying to follow this steps although I'm not very confident in my php skills . Eventually I will ask again for your help. Thank you very much.
×
×
  • Create New...