Jump to content

mr-fan

Members
  • Posts

    848
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by mr-fan

  1. i've searched many times for just upload single images on user template without creating a new page...and best found was the gist from soma: https://gist.github.com/somatonic/4150974 But i've stucked don't get the upload working on this....if i did a var_dump on the upload array it is emty...hit my head on the wall while searching the issue... my edited code with some debug messages: <?php //color the code somas code below // front-end form example with multiple images upload // add new page created on the fly and adding images if($input->post->user_img){ // tmp upload folder for additional security $upload_path = $config->paths->root . "tmp_uploads/"; // new wire upload $u = new WireUpload('user_img'); $u->setMaxFiles(1); $u->setOverwrite(true); $u->setDestinationPath($upload_path); $u->setValidExtensions(array('jpg', 'jpeg')); // execute upload and check for errors $files = $u->execute(); //just some checks whats going on...$files is empty $upload_path seems to be right! $successMessage .= var_dump($files); $successMessage .= $upload_path.'<br>'; if(!$u->getErrors()){ // add images upload foreach($files as $filename) { $successMessage .= $filename; $user->user_img = $upload_path . $filename; } // save page $user->save(); // remove all tmp files uploaded foreach($files as $filename) //unlink($upload_path . $filename); $successMessage .= "<p class='message'>Files {$filename} uploaded!</p>"; } else { // remove files foreach($files as $filename) //unlink($upload_path . $filename); // get the errors foreach($u->getErrors() as $error) $errorMessage .= "<p class='error'>$error</p>"; } } And here is the form itself...it is in a var to echo the whole thing...with some options ans so on... // display a user settings form $settingsForm = " <!-- general form elements --> <div class='box box-primary'> <div class='box-header'> <h3 class='box-title'>Voreinstellungen ändern:</h3> </div><!-- /.box-header --> <!-- form start --> <form name='settings' role='form' action='./' method='post'> <div class='box-body'> <div class='form-group'> <label for='user_an'>Auswahl Auftragnehmer</label> <select name='user_an' class='form-control' id='user_an'> ".$optionsLu." </select> </div> <div class='form-group'> <label for='user_mr'>Auswahl Maschinenring</label> <select name='user_mr' class='form-control' id='user_mr'> ".$optionsMr." </select> </div> <div class='form-group'> <label for='exampleInputFile'>Profilbild ändern</label> <input name='user_img' type='file' id='user_img' accept='image/jpg,image/jpeg'> <p class='help-block'>Nur jpg Bilder sind erlaubt!</p> </div> </div><!-- /.box-body --> <div class='box-footer'> <button type='submit' class='btn btn-primary'>Ändern</button> </div> </form> </div><!-- /.box --> "; Really have no clue why the upload array is emtpy? Best regards mr-fan
  2. This weekend i'm in short trip to Hamburg for vacation... But you could write me a pm if i could help....not really fit with module creating but good with a helping hand and testing if needed? Best regards mr-fan
  3. Nope User template... take a look at edit templates at the top ->filter ->show system templates.....in PW the backend is not really more than the frontend... So you can add fields to the user template like a pagefield! So now there are many options again.... 1. should the admin set the users to the videos or 2. should the admin set the videos for the user it's a kind of usability question here....so how many users how many videos? Option 2 should be the best since it all depends personally - so you could create a little special admin page to let the coach choose first which user and then add some videos all on one page. Take also a look at http://modules.processwire.com/modules/process-admin-custom-pages/ this is unique with PW while you have all options on your side....
  4. For thoose how work with AdminCustomFiles Module: https://processwire.com/talk/topic/7588-admin-custom-files/ You could easy get this both together just setup the docs - but instead of loading via ACP_scripts_and_styles field and on the admin template you could use this two files to get all the things right up...unzip the package in your "AdminCustomFiles" Folder and use it only with the output generating php stuff in the admin template like above: <?php //only load the doc pages without js or css all done via AdminCustomFiles for ProcessAdminCustomPages $docs = $pages->get(1149); ?> <div id="docs"> <ul id="cbp-ntaccordion" class="cbp-ntaccordion"> <?php foreach($docs->children('include=all') as $doc) { ?> <li> <h3 class="cbp-nttrigger"><?php echo $doc->title ?></h3> <div class="cbp-ntcontent"> <?php echo $doc->body;?> </div> </li> <?php } ?> </ul> </div> Thanks to Macura for this great idea! Regards mr-fan ProcessAdminCustomPages.zip
  5. for CKE you will need some CKEEditor addon like this one: http://ckeditor.com/addon/flash be shure about the right settings have a read in this thread: https://processwire.com/talk/topic/7854-iframes-are-being-stripped-from-ckeditor-field-even-when-explicitly-allowed/#entry76826 OR have a look at this textformatter: http://modules.processwire.com/modules/textformatter-video-embed/ OR other way could be to work with HTML hannacode. https://processwire.com/talk/topic/3745-hanna-code/ best regards mr-fan
  6. Thanks it's working perfect now...like you thought...some codecleaning get it working. On this project i'm working with a paid themeforrest html template that fits to the client - but on such themes there are almost many things to improve exspecially some overloaded usage of scripts and plugins on such themes...so i've tidy up first and the compress and minify. regards mr-fan
  7. Just make some steps with AIOM and have a strange issue: CSS works fine but with the JS files on a quick and dirty try it seems that the exact same scripts won't work with AIOM and with single loading the do.... Q&D Code below: <!-- jQuery --> <!--<script src=" <?php //echo AIOM::JS( // array( // 'tpl/js/jquery.js', // 'tpl/js/bootstrap.min.js', // 'tpl/js/owl-carousel/owl.carousel.min.js', // 'tpl/js/easytabs/easyResponsiveTabs.js', // 'tpl/js/jquery.easing.min.js', // 'tpl/js/flex-slider/jquery.flexslider.js', // 'tpl/js/jquery.appear.js', // 'tpl/js/jquery.inview.js', // 'tpl/js/jquery.prettyphoto.js', // 'tpl/js/jquery.nicescroll.js', // 'tpl/js/main.js' // )); ?> "></script>--> <script src="<?php echo $config->urls->templates?>tpl/js/jquery.js"></script> <script src="<?php echo $config->urls->templates?>tpl/js/bootstrap.min.js"></script> <script src="<?php echo $config->urls->templates?>tpl/js/owl-carousel/owl.carousel.min.js"></script> <script src="<?php echo $config->urls->templates?>tpl/js/jquery.easing.min.js"></script> <script src="<?php echo $config->urls->templates?>tpl/js/flex-slider/jquery.flexslider.js"></script> <script src="<?php echo $config->urls->templates?>tpl/js/jquery.inview.js"></script> <script src="<?php echo $config->urls->templates?>tpl/js/jquery.prettyphoto.js"></script> <script src="<?php echo $config->urls->templates?>tpl/js/jquery.nicescroll.js"></script> <script src="<?php echo $config->urls->templates?>tpl/js/main.js"></script> Before posting i've checked the created files for shure. all code seems to be there - disabled minifying in AIOM only take the files together...??
  8. Just hold the new c't one of the big german computer magazines....it's a 4 page article....very nice written. some extractions translated: ...backlinks online and in the end of the article $pw->awesome->url = http://ct.de/ybn5 best regards and a great weekend mr-fan
  9. here we go: https://processwire.com/talk/topic/107-custom-login/#entry735 <?php //color your code! if($user->isLoggedin()) { // user is already logged in, so they don't need to be here $session->redirect("/somewhere/"); } // check for login before outputting markup if($input->post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; if($session->login($user, $pass)) { // login successful $session->redirect("/somewhere/"); } }
  10. This is what is the most and big point of this awesome community here. There is no huff and saying - we have the best CMS so your problems are no problems - so live with them... Here is instant writing and thinking - we have the best CMS so there must be one/more ways to get this problems away... Thank you Peter for this threat - i discovered AdminCustomFiles while reading your write-up. Best regards mr-fan
  11. @Martijn Geerts THIS module is a really great one! Thank you very much - just experimented with it a little bit and result is: easy == awesome best regards mr-fan
  12. @mats Awesome thank you very much for openstreetmap Version!! Best regards mr-fan
  13. Just to sort up the things you've mixed... Frontend Look == Your Choice and your CSS under /site/templates Backend Look / CSS Classes in CKE / Float right, left and so on.... == just Backend styling not related to the Frontend until you setup up all that stuff... Let's go How to: 1. Frontend first - How your CSS get the HTML from the Wysiwyg? 2. Frontend CSS - What classes you use for your template image left, right and so on 3. What is CKE changing in the Source if you click on "Image left" -> take a look for that Output with the source button in CKE after changing something with the Style things 3. CKE modification to get the look like in the frontend -> 2 files are to setup/create/put the path in the field settings! --> mystyles.js (may you create one in /site/templates/scripts) --> contents.css (may you create one in /site/templstes/styles) What? What do this files...ok this two files do two things... 4. mystyles.js This could be set in your CKE Field to the path of your choice and "override" the items in the "styles" menu!! Really cool stuff to setup here. Example from real Life (the labels in german but i think you get the idea how to use it...): CKEDITOR.stylesSet.add( 'mystyles', [ //images { name : 'Bild links mit Vorschau' , element : 'img', attributes : { 'class' : 'thumbnail align_left vorschau' } }, { name : 'Bild rechts mit Vorschau' , element : 'img', attributes : { 'class' : 'thumbnail align_right vorschau' } }, //lists //{ name : 'Liste mit Pfeil' , element : 'ul', attributes : { 'class' : 'pfeil' } }, //{ name : 'Liste mit Check' , element : 'ul', attributes : { 'class' : 'check' } }, //headings { name : '3 Alt. Schrift' , element : 'h3', attributes : { 'class' : 'extrafont' } }, { name : '4 Alt. Schrift' , element : 'h4', attributes : { 'class' : 'extrafont' } }, //tables { name : 'Tabelle normal' , element : 'table', attributes : { 'class' : 'pure-table' } }, { name : 'Tabelle mit Rahmen' , element : 'table', attributes : { 'class' : 'pure-table pure-table-bordered' } }, { name : 'Tabelle nur Zeilentrennung' , element : 'table', attributes : { 'class' : 'pure-table pure-table-horizontal' } }, /* Object Styles */ // This styles are only available when you select the defined objects. E.g. when selecting an image // you can control here with the styles dropdown the styling. // Here you can define Divbox classes as well these are shown on "Create div Container" { name : 'Gruene Box', element : 'div', attributes : { 'class' : 'alert alert-success', } }, { name : 'Gelbe Box', element : 'div', attributes : { 'class' : 'alert alert-warning', } }, { name : 'Rote Box', element : 'div', attributes : { 'class' : 'alert alert-danger', } } ]); 5. contents.css The contents.css override the CSS of the content of the CKE field in the backend so this is the thing where you tell the CKE how to look like your frontendcontent...for example also the background image fo the frontend could shown up in the backend... Example: /** * General editor styles (regular mode only) * * See contents-inline.css for inline styles. * */ /* Template CSS ONLY */ @import url("bootstrap.css"); @import url("font.css"); @import url("style.css"); /* WORKSPACE EDITOR SETUP */ body { padding: 10px; } /* CORRECT THE ORIGINAL STYLESHEET */ Oh this was the easy part just import your stylesheets in there and correct some wired things like add some padding in the CKE only to get some whitespace for the editor... Some more Links on this topic: https://processwire.com/talk/topic/8342-adding-css-classes-to-ckeditor/ http://docs.ckeditor.com/#!/guide/dev_styles http://www.flamingruby.com/blog/processwire-weekly-13/#1-1 regards mr-fan
  14. Sometimes i work with themeforrest HTML themes on projects with low budget...fun fact is with PW I get a HTML theme up and running with normal content in a few minutes... But hey a WordPress theme with xxx dependencies and a insecure cms only cost the double price...
  15. @Bernhard this is the exact way for your example: https://highlightjs.org/usage/ important question would be -> have we API access to the setting of the language from the backend...so you could set easy the <pre> class for the language to show... regards mr-fan
  16. PageTableExtended will eat this like no repeater before....
  17. Alternative for Process Dashboard is the AdminCustomPages module... http://modules.processwire.com/modules/process-admin-custom-pages/ with this one you could assign a normal php template to a backend page and do what you want without creating a processmodule...so you could easy use something like this example: https://processwire.com/talk/topic/9136-preconfigured-lister-in-custom-admin-page/#entry88364 to get some content or use other options to get pages by role via api and save them. regards mr-fan
  18. or you use simply this little snippet in your admin.php: <?php //ignore /** * change page name on publishing a post and add the created date to the name */ $pages->addHook('saveReady', null, 'buildUrl'); function buildUrl(HookEvent $event) { $page = $event->arguments[0]; if($page->template != 'aktiv') return; //for this template only if($page->id && $page->isChanged('status') && !$page->is(Page::statusUnpublished)) { $result = wire('db')->query("SELECT status FROM pages WHERE id={$page->id}"); list($status) = $result->fetch_row(); if($status & Page::statusUnpublished) { // page is about to be published $dateCreated = date("Y-m-d", $page->created); $page->name = $page->title."-".$dateCreated; $page->message($page->created . $page->name); } } } it changes the url only until the page is published...i use this with the awesome module from adrian: http://modules.processwire.com/modules/page-rename-options/ so user could 1. setup a page change the title == changes the name until he publish the page 2. snippet run and change the output that is needed....finish pageurl is protected and stays forever and ever.... ....the modules mentioned are good as well...but i like more and more the power of a few lines of code in PW regards mr-fan
  19. There you find your answer.... https://processwire.com/talk/topic/1648-ok-to-change-page-name-path-after-save/#entry15232 best regards mr-fan
  20. Great to read that you get one of the "pw" moments that shows that everything is possible... I am very glad to help and say thank you for sharing. Best regards mr-fan
  21. wanna share that new shiny star on the autocomplete horizon... http://leaverou.github.io/awesomplete/ looks very very interesting i think!
  22. one is missing.... .processwire { position: absolute; transform: scale(auto); right: 100%; color: #fa5732; } Edit: forgot the color..
  23. smile of my week....i like to share: http://saijogeorge.com/css-puns/ have fun mr-fan
  24. Great to hear....if you strech your brain once in the right direction with PW there will be almost no limits....
  25. Like kongondo described images are in PW a kind of ressources/objects in a page template or if you want a image could be a single page, too. There is no right or wrong way - PW let the choice up to you how do you use images or let your editors use images. so you have a few options to go: 1. give your template a imagefield (single or multiple images) user can choose from this images in the content or from other images on other pages 2. build up a little gallery structure (you could use some hints/links from this post scroll down to the image things https://processwire.com/talk/topic/7836-cant-wait-first-project-with-pw-nearly-finished/) -image-root --image1 (single image field) --image2 (single image field) => maybe use this one to change the image parent for the imageselection in the CKE https://processwire.com/talk/topic/3023-module-ckeditor/page-10#entry71674 3. Soma's image manger solution https://processwire.com/talk/topic/3219-images-manager-beta/ xxx many other ways to get there in PW The first one is the easiest way to go. Best regards mr-fan
×
×
  • Create New...