Jump to content

davo

Members
  • Posts

    283
  • Joined

  • Last visited

Everything posted by davo

  1. I'm using the following template to create a new page by the user. What I'd like to do is after saving the page, immediately return the page id of the newly created page. I'm not sure if this is possible in the same page submission. Any ideas? <?php /** * Page template * This template actually creates the event for the agent */ include("./dmcheader.inc"); $event_date = $sanitizer->text($input->post->event_date); //get the details from the previous pages form $event_details = $sanitizer->textarea($input->post->event_details); $event_name = $sanitizer->text($input->post->event_name); $t = new Page(); // set the new page up $t->template = $templates->get("agent_event"); // use the template agent_event $t->parent = $pages->get(2112); // attach it to the events parent $t->title = $event_name; // use the use the name $t->agent_event_date = $event_date; // use the date - still needs work from the front end formatter and picker $t->body = $event_details; // event details go to the body $t->save(); // create the page // give current current user access to edit previously created page $user->editable_pages->add($t); $user->save('editable_pages'); ?> <title><?=$page->title?></title> </head> <div class="container" style="margin-top:30px"> <div class="col-md-4 col-md-offset-2" > <div class="panel panel-default"> <div class="panel-heading"><h3 class="panel-title"><strong><h2>Brilliant</h2></strong></h3></div> <div class="panel-body"> <p>Your event has been created <?php echo "{t->id}" ; ?></p> </div> </div> </div> </div> <?php include("./dmcfooter.inc");
  2. davo

    Page Audit

    Yes, I agree. It's just that extra scoop audit / me trying to be smart. It's possible someone may use the site and get information from it a long time before the officiallly register for it. Although, with the multiple device issue, that could do the cookie sweep next time they're logged on to that additional device yes?
  3. davo

    Page Audit

    Thank you, I'll have a read. I know what you mean. I think I'll run the whole concept past the client and see what's most important for them. I could be they only want to see if the page has been visited "ever", ie if the introduction has ever been made then the criteria has been met. I do have a stage 2 in mind once this has settled. I'm thinking of: Where a page has been visited and the user is guest, drop a cookie with a page ID in it. Then, when a logged in user visits that, PW collects any cookies and adds them to the audit log adding a logic to the row to say if the entry was generated from a logged in user or guest, but on a computer that is now associated with that account. What do you think?
  4. davo

    Page Audit

    Works perfectly: What does this mean? $visits->of(false);
  5. davo

    Page Audit

    Mr fan The pages I want to audit can be viewed as a guest or logged in user. Logged in users just get extra functionality such as being able to add notes etc to a page. My plan is to use the api to capture logged in users visiting a page. If they aren't logged in I want to drop a cookie which will up date the audit log when they become logged in.
  6. davo

    Page Audit

    Exactly what I was thinking, although I may well add in the referrer too mentioned above. That might well help us work out where traffic comes from.
  7. Thank you both. I'm still fair new to the api I sometimes take the examples I see 'literally'.
  8. I'm trying to get the login form on my site to redirect a user if they have the role "agent". I'm using the following code and i thought using 'has role' I would be able to conditionally redirect a user but it's always choosing the else option at the moment. Are there any glaring mistakes in my code? <?php if($user->isLoggedin()) $session->redirect('/portal/agent-portal/'); if($input->post->username && $input->post->pass) { $username = $sanitizer->username($input->post->username); $pass = $input->post->pass; $u = $users->get($username); if($u->id && $u->tmp_pass && $u->tmp_pass === $pass) { // user logging in with tmp_pass, so change it to be their real pass $u->of(false); $u->pass = $u->tmp_pass; $u->save(); $u->of(true); } $u = $session->login($username, $pass); if($u) { // user is logged in, get rid of tmp_pass $u->of(false); $u->tmp_pass = ''; $u->save(); // now redirect to the profile edit page if ($user->hasRole("agent")) { $session->redirect('/portal/agent-portal/');}else{ $session->redirect('/portal/profile/'); } } } // present the login form $headline = $input->post->username ? "Login failed" : "Please login"; $page->body = " <h2>$headline</h2> <form role='form' action='./' method='post'> <div class='form-group'> <label for='username'>Username </label> <input type='text' class='form-control' style='border-radius:0px' id='username' placeholder='username' name='username'> </div> <div class='form-group'> <label for='pass'>Password</label> <input type='password' class='form-control' style='border-radius:0px' id='pass' placeholder='Password' name='pass'> </div> <button type='submit' class='btn btn-sm btn-default'>Sign in</button> </form> <p><a href='/reset-pass/'>Forgot your password?</a></p> "; $page->editor = "Login to view content editor"; include("./main.php"); // main markup template
  9. davo

    Page Audit

    Thank you. That makes interesting reading which I'll explore. I was thinking of quite a simple audit really. Something like; If current user is not guest, write page id, user, date and time to another table. Maybe even use Ryan's flat table module for speed. Suppliers often claim that the client introduction was made by another service. All my client needs to prove is their site was viewed prior to the sale taking place to prove on a balance of probabilities.
  10. I have a site that i'm developing where audit is important to prove commissions; ie has a client met the supplier through another means, or can it be proved that they visited this site prior to sale? I don't suppose anyone is aware of a module that will simply log that where a user is logged in they have visited a particular page? If not i'm sure I can develop something for this but don't want to waste my time on something that has already been done.
  11. That worked very well thank you. Just out of interest, does that api feature rely on page edit module or does it work out the box with the core?
  12. No, you're absolutely right. I do already have the user. I was trying to express 'add a user' to a page permission rather than 'add a role'. So i think you're right; I just need to add the following to my api for creating the page. I'll give it a try a bit later. Thank you. // give current current user access to edit previously created page $user->editable_pages->add($p); $user->save('editable_pages');
  13. Thank you. I ended up kicking myself last night as my form wasn't creating the page fields properly just because the date was back to front. Shouldn't be a problem but as the example used 08/04 and 04/08 I had no way of knowing if it was mmdd or ddmm. If the example used a dd over 12 it would be more obvious to fools like me To add to my grumpiness I found that the HTML 5 date picker isn't supported by ie or Firefox.
  14. The first option I think is what I'm after. I couldn't find in any documentation an api call to add a user; I only found one to add a roll. Is this possible?
  15. I've created a form that allows the current user to create a page (it's an event planning portal). To edit the page, I intended for them to use the modal=1 argument for quick access. I don't want to give all users access to edit all pages, only the ones they have been the creator for. How do I achieve this? For other type of page I had been using 'page edit per user' module, but that involves me manually adding a page to the user's account.
  16. The date field input format picker is a little confusing for me. The two examples are 08/04/2012 and 04/08/2012, but don't make it obvious which is the month and which is the day. Maybe use a date where it would be impossible to get it wrong? Like 14/08/2012. Just an idea
  17. So I've made a function that is supposed to look for all gallery template pages that have a minimum number of photos in it and using the bootstrap frame work, line them up to head a page. The value passed to the function is always 12. function minigallery($dmc, $no_pictures){ $thumbWidth = 200; $thumbHeight = 200; $gallery_page = wire('pages')->get("template=gallery-album, DMC_select=$dmc"); //find the first l page that are gallery-album template and that match the DMC $gallery_stack = $gallery_page->images; if($gallery_stack->count > 11){ $gallery_images = $gallery_stack->getRandom(12) ; echo "<div class='container'> <div class='row'>"; foreach($gallery_images as $gallery_image) { $thumb = $gallery_image->size($thumbWidth, $thumbHeight); echo "<div class='col-xs-1 dmc_strip'> <img class='img img-responsive' src='{$thumb->url}'> </div>";} echo "</div> </div>"; } } What i'm not sure how to do is add to the selector a count of the images. I only want it to return galleries that have at least 12 images on the page. Could someone advise how I'd do this please?
  18. davo

    A virtual Company

    I have a moderate work load of sites that I develope. Some times I get more than I can handle. Some times I have more than my current skill level can handle. I'd like to expand my sole trading business to work with some more designers developers. Nothing too heavy, but I'd like to have on board some people that would like to take on jobs and be featured on my website as a developer. In return, each of the people should be able to feature each of the developers on their own website as their virtual company. The idea being that the local contact can arrange face to face meetings, specs etc and any of the remote workers can take on parts or all of the projects. I'd be very interested to know if anyone would be interested in this concept, what they typically expect as payment and any other thoughts. Feel free to reply to this topic for public forum chat or pm. David
  19. I have a quite a number of pages that have the same name; and in hindsight I would have designed the structure to this site a little different. The issue I have now is when I'm selecting a page from a page selector field, I don't know which one it is as there are sometimes three others with the same name. When selecting them in a page selector view, is it possible to maybe combine the page title and an extra field held within the page?
  20. Thank you. Looks great. http://dmc.dudmc.com/about-du-and-dmcs/what-is-a-dmc-destination-management-company/ I'm learning bootstrap at about the same rate as pw, so all help gratefully received.
  21. Nice , I like the fields demo. I assume this is where the staff can easily log in to change prices. I'm working on something similar at the moment.
  22. Thank you. I'll try this out tonight. Totally agree about the comments. I started doing this as of last night when I started to get lost in my own code mess! Cheers
  23. Thank you Macrura This almost worked, but it dropped the third column and produced the following result. <!DOCTYPE html> <html lang="en"> <head> <meta name="verification" content="81dab63472f4ac83c90d62c4aaf071f8" /> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="../../docs-assets/ico/favicon.png"> <title> What is a DMC (Destination Management Company) </title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <!-- Bootstrap core CSS --> <link href="/site/templates/dist/css/bootstrap.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="/site/templates/customcss/custom.css" rel="stylesheet"> <!-- Custom styles for the scroller template --> <link href="/site/templates/assets/css/main.css" rel="stylesheet"> <link href="/site/templates/assets/css/prism.css" rel="stylesheet" /> <link href="/site/templates/assets/css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" /> <!-- Just for debugging purposes. Don't actually copy this line! --> <!--[if lt IE 9]><script src="../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]--> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> <!-- Custom styles for this template --> <link href="/site/templates/customcss/navbar-fixed-top.css" rel="stylesheet"> <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script> </head> <body> <!-- Static navbar --> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand visible-lg visible-md" href="/"><img src="/site/templates/dulogotrans.png"></a> <a class="navbar-brand visible-xs visible-lg" href="/"><span style="color: #000066">destinations</span> UNLIMITED</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <!-- <li class="active"><a href="/">Home</a></li> --> <li class="dropdown" > <a href="#contact" class="dropdown-toggle" data-toggle="dropdown" ><span class="glyphicon glyphicon-info-sign"></span> About Us<b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="/about-du-and-dmcs/about-du/">About destinations UNLIMITED</a></li> <li><a href="/about-du-and-dmcs/why-us/">Why Us</a></li> <li><a href="/about-du-and-dmcs/what-we-do/">DMC Criteria</a></li> <li><a href="/about-du-and-dmcs/what-is-a-dmc-destination-management-company/">What is a DMC</a></li> <li><a href="/about-du-and-dmcs/destinations-unlimited-csr-policy/">destinations UNLIMITED CSR Policy</a></li> <li><a href="/faqs/">FAQs</a></li> <li class=''><a href="/meet-the-team/">Meet The Team</a></li> <li class=''><a href="/about-du-and-dmcs/dmc-du-in-the-news/">dU In The News</a></li> <li class=''><a href="/events/calendar-of-events/">Calendar of Events</a></li> </ul> </li> <li class="dropdown" > <a href="#contact" class="dropdown-toggle" data-toggle="dropdown" ><span class="glyphicon glyphicon-search"></span> DMCs Worldwide<b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="/region/">Represented DMCs</a></li> <li><a href="/dmc-non-represented/">Additional DMCs</a></li> <li><a href="/destination-updates/">Destination Updates</a></li> <li><a href="/destination-showcases/">Destination Showcases</a></li> <li><a href="/destination-deal-finder-results/">DMC Showcase Finder</a></li> </ul> </li> <li class="dropdown" > <a href="#contact" class="dropdown-toggle" data-toggle="dropdown" ><span class="glyphicon glyphicon-book"></span> Resources<b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="http://www.dudmc.com/brochure/du2013july/du2013july.html">dU Brochure</a></li> <li><a href="/destination-videos">DMC Destination Videos</a></li> <li class="divider"></li> <li><a href="/links/conference-and-incentive-useful-links">Conference and Incentive Links</a></li> <li><a href="/events/annual-event-and-congress/">Annual Events and Congress</a></li> <li class=''><a href="/gallery/">Image Gallery</a></li> <li class=''><a href="/dmc-special-offers/">DMC Special Offers</a></li> <li class=''><a href="/dmc-news/">DMC News</a></li> <li class='disabled'><a href="">CSR Ideas</a></li> </ul> </li> <li class="dropdown" > <a href="#contact" class="dropdown-toggle" data-toggle="dropdown" ><span class="glyphicon glyphicon-thumbs-up"></span> Testimonials<b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="/testimonial-types/testimonials-from-event-companies/">Testimonials From Event Companies</a></li> <li><a href="/testimonial-types/dmc-client-testimonials/ ">DMC client Testimonials</a></li> <li><a href="/testimonial-types/partner-dmcs/ ">Partner DMCs</a></li> <li class="divider"></li> <li><a href="/forms/review/ ">Leave a review</a></li> </ul> </li> <li class="dropdown" > <a href="#contact" class="dropdown-toggle" data-toggle="dropdown" ><span class="glyphicon glyphicon-envelope"></span> Contact<b class="caret"></b> </a> <ul class="dropdown-menu"> <li class='' ><a href="/forms/request-for-proposal/">Request For Proposal</a></li> <li class='' ><a href="/forms/mailing-list/">Join Our Mailing List</a></li> <li class='' ><a href="/forms/get-in-touch/">Get In Touch</a></li> </ul> </li> </ul> <ul class="nav navbar-nav navbar-right visible-lg"> <li><a href="http://uk.linkedin.com/company/destinations-unlimited---dmc-representation?trk=ppro_cprof" target='_blank'><img src="/site/templates/assets/img/social/linked-in.gif"></a></li> <li><a href="https://www.facebook.com/dUDMCs" target='_blank'><img src="/site/templates/assets/img/social/facebook.gif"></a></li> <li><a href="https://twitter.com/dU_DMCs" target='_blank'><img src="/site/templates/assets/img/social/twitter.gif"></a></li> <li><a href="https://www.youtube.com/channel/UCY4C2Xfg-GZzhakz7_EtCZA" target='_blank'><img src="/site/templates/assets/img/social/youtube.gif"></a></li> <li><a href="https://plus.google.com/+Dudmc/posts" target='_blank'><img src="/site/templates/assets/img/social/googler.gif"></a></li> <li><a href="http://www.pintrest6.com/dudmc/" target='_blank'><img src="/site/templates/assets/img/social/pintrest6.gif"></a></li> </ul> </div><!--/.nav-collapse --> </div> </div> <div class='container'> <div class='row'> <div class='col-md-12'> <h2 class="art-postheader">What is a DMC (Destination Management Company) ?</h2><p>A DMC provides local destination knowledge and they act as a extension of your company</p><p>A DMC (Destination Management Company) offer the following logistic services in their destination; Meet and Greet, Transfers / Transportation, Hotel Accommodation, Restaurants, Activities, Excursions, Conference Venues, Themed Events, Gala Dinners and Logistics. Naturally, DMCs assist with overcoming any language barriers.</p><p>A DMC must be someone that you can relate to and trust, whilst they assist you on both a creative and professional level. They are often able to provide preferential rates based on the buying power that they have with their preferred suppliers.</p><p>The above is only a basic overview of the services that a DMC can provide.</p> </div> </div><div class='row'><div class='col-md-4'><ul><li>Egypt Incentives and Events African</li><li>Destination Kenya African</li><li>Unitours Maroc African</li><li>Green Route African</li><li>Expresso Veiga African</li><li>Mauritours African</li><li>Select-Seychelles African</li><li>Tour East Asia</li><li>Cox & Kings Ltd Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Cox & Kings Ltd Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Toptour (Europe) Limited Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Tour East Asia</li><li>Cox & Kings Ltd Asia</li><li>Tour East Asia</li><li>Cox & Kings Ltd Asia</li><li>Arinex Australasian</li><li>Arinex Australasian</li><li>Arinex Australasian</li><li>Tahiti Nui Travel Australasian</li><li>Connect Travel Services Carribean</li><li>Barefoot Holidays Carribean</li><li>Carib World Travel Carribean</li><li>Sunlinc Barbados Carribean</li><li>Business Serenity Carribean</li><li>Sunlinc Grenada Carribean</li><li>Travel Services Inc Carribean</li><li>Sunlinc St. Kitts Carribean</li><li>Premier Destination Services Carribean</li><li>Elcotour Central and South American</li><li>SAT Mexico Central and South American</li><li>Top Dest Central and South American</li></ul></div><li>S & L Travel Services and Tours Central and South American</li><li>Turismo Balsa Central and South American</li><li>Destination Management Chile Central and South American</li><li>Vitramar Central and South American</li><li>Via-Tur Central and South American</li><li>Ecuadorian Tours Central and South American</li><li>Servicios Turisticos del Peten (STP) Central and South American</li><li>Eventos Kreativos Internacional Central and South American</li><li>Intertours Central and South American</li><li>Coltur Peru Central and South American</li><li>Turisport Ltd Central and South American</li><li>Condor Verde Central and South American</li><li>AIM Group International European</li><li>Borealis European</li><li>AIM Group International European</li><li>First United European</li><li>Metropolis European</li><li>CPO Hanser European</li><li>Weichlein European</li><li>Conceptours European</li><li>ITB Holland European</li><li>AIM Group International European</li><li>Atlantik European</li><li>Wallace Travel European</li><li>Intercontinental Travel Company European</li><li>EC Meetings European</li><li>Travel Planners of Scandinavia European</li><li>Mazurkas Travel European</li><li>XPTO Marketing European</li><li>Accent Travel European</li><li>ITB DMC European</li><li>ITB DMC European</li><li>ITB DMC European</li><li>Risbecker European</li><li>Ovation European</li><li>Gemini European</li><li>Rusmice European</li><li>AIM Group International European</li><li>Dubrovnik Travel European</li><li>CPO Hanser European</li><li>Con-ex European</li></ul></div><li>Travellers Choice European</li><li>Spectra European</li><li>Con-ex European</li><li>Con-ex European</li><li>AIM Group International European</li><li>ITB DMC European</li><li>Albatros Travel DMC European</li><li>1001 Events Middle Eastern</li><li>1001 Events Middle Eastern</li><li>Egypt Incentives & Events Middle Eastern</li><li>Eshet Incentives & Conferences Middle Eastern</li><li>Karma House Middle Eastern</li><li>1001 Events Middle Eastern</li><li>Tamna Events Middle Eastern</li><li>Canadian Tours International CTI North America and Canadian</li><li>Incentive Travel & Meetings Atlanta North America and Canadian</li><li>NxtEvent North America and Canadian</li><li>AgenTours North America and Canadian</li><li>Manhattan Passport North America and Canadian</li><li>Capitol Services Inc North America and Canadian</li><li>Select Sites Group North America and Canadian</li><li>Agentours North America and Canadian</li><li>Charlotte Arrangement North America and Canadian</li><li>Incentive Travel & Meetings North America and Canadian</li><li>GET Destinations North America and Canadian</li><li>Convention Designs North America and Canadian</li><li>Capitol Services Inc North America and Canadian</li><li>Agentours North America and Canadian</li><li>Passport New Mexico North America and Canadian</li><li>Albrecht Events North America and Canadian</li><li>Destination St. Louis North America and Canadian</li><li>MAC Meetings North America and Canadian</li><li>Destination San Antonio North America and Canadian</li><li>NxtEvent North America and Canadian</li><li>Destination Nashville North America and Canadian</li><li>Incentive Travel & Meetings North America and Canadian</li><li>Key Events & Helen Moscovitz Group North America and Canadian</li><li>Ultimate Ventures North America and Canadian</li><li>Accent on Arrangements North America and Canadian</li></div> </div !-- end container --> <!-- FOOTER --> <div id="footer"> <div class="container"> <p class="pull-right"><a href="#">Back to top</a></p> <p>© 2014 dU, Inc. · <a href="#">Privacy</a> · <a href="#">Terms</a></p> <p class="text-muted">destinations UNLIMITED Tel: + 44 (0) 1425 461311 - Email: info@dudmc.com - Skype Address: duoffice Address: 7 High Street, Ringwood, Hampshire, BH24 1AB, United Kingdom - <a href='/portal/login'>DMC Login</a> </p> </div> <!-- <img class='img img-responsive' src='/site/templates/assets/img/dmc_bottom_banner.jpg'> --> </div> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="/site/templates/dist/js/bootstrap.min.js"></script> <script src="/site/templates/assets/js/jquery.mCustomScrollbar.min.js"></script> <script src="/site/templates/jquery.newsTicker.js"></script> <script> $('a[href*=#]').click(function(e) { var href = $.attr(this, 'href'); if (href != "#") { $('html, body').animate({ scrollTop: $(href).offset().top - 81 }, 500); } else { $('html, body').animate({ scrollTop: 0 }, 500); } return false; }); $(window).load(function(){ $('code.language-javascript').mCustomScrollbar(); }); var nt_title = $('#nt-title').newsTicker({ row_height: 40, max_rows: 1, duration: 3000, pauseOnHover: 0 }); var nt_example1 = $('#nt-example2').newsTicker({ row_height: 50, max_rows: 1, duration: 4000, prevButton: $('#nt-example2-prev'), nextButton: $('#nt-example2-next') }); </script> <script>var as_config = {"as_minLength":2,"as_close_text":"close","as_search_form":"#my_search_form","as_search_input":"#my_search_query","as_query_name":"q","as_query_url":""};</script> <script src='/site/modules/AjaxSearch/AjaxSearch.js'></script></body> </html> The reason I had this part in: $new_region = $dmc->parent->title; // why the same variable? $region = $dmc->parent->title; is because each of the dmcs in the list come under a different parent. I'd ordered the array by the parent. When I put those to variables in that look the same, I put one at the start of the loop and one at the end and the test in the middle. That way when it ran through the loop, if the region was different to the one triggered by the previous loop item then it would print the new region in a fancy new label.
×
×
  • Create New...