Jump to content

davo

Members
  • Posts

    283
  • Joined

  • Last visited

Everything posted by davo

  1. destinations UNLIMITED This site is a conversion from an old Joomla site that is far better suited to processwire due to the 100s of facts and figures about the destinations. Many of the facts from each of the destinations help to form other content such as blurbs on the video content hopefully adding quality content for google to index. It's also got a growing number of features for registered users such as being able to add personal comments to destinations which collate into a personal notebook. Hope you enjoy having a look around. Although the site is now live, I don't think it will ever be finished! ..not to forget a thank you to everyone who has helped me with the project along the way!
  2. I'm planning out a new project and I intend to have information stored against each user. Some may be editable by the users and other fields not editable by the users. Would it be best to simply create the fields in the users' templates but then use a module to restrict viewing and editing || Would it be best to create a linked user template to store this additional information where the user just doesn't have access to the template? The sort of information that might be in the extra restrictive fields are information like scores and points.
  3. I can't find that in /site/config.php mine ends: $config->userAuthSalt = 'xxxxxxxxxxxxxxxxxxxxxxxxx'; /** * Installer: File Permission Configuration * */ $config->chmodDir = '0755'; // permission for directories created by ProcessWire $config->chmodFile = '0644'; // permission for files created by ProcessWire
  4. I can't find any reference to the domain in this file? What line should it be on?
  5. Hmmm, the only issues I've had recently were when moving a site to a bitnami stack for off line use. The problem I found with that was the default installation was something like localhost/processwire. This didn't work so well when I tried to import the site into it. The way I got around this was to clone the virtual server the production site was running on and run it on virtual box on the laptop. Possibly over kill but worked. The first option did at least high light the issue of urls to me.
  6. Originaldomain.com has the original site Subdomain.originaldomain.com has the new site. These are both on a production server but on completely different vhosts. When one site is reAdy to take over, the original domain vhost is renamed to old.originaldomain.com and the new site is renamed to originaldomain.com This way both sites stay live with minimal down time and ability to switch back should there be issues. I'm sure others have many other ways to achieve the same
  7. Thanks. All noted FYI, sub domain was being used as the original domain is being used for the existing site. Have to run in parallel for a short while.
  8. Thank you So you'd normally just express it as /URL/to/my/page then. No need for the domain? The reason I ask is I've been developing a site on a sub domain, soon to be the real domain. Just trying to prep for the change over
  9. What's the advantage of $config->httpHost/my/page over just /my/page when making references in templates.
  10. Another way could be to use google webmasters. I believe it can create a spreadsheet of all your indexed pages. The copy that into the redirects module and start adding target links.
  11. I think the screencast I watched must be from old functionality. Is there nothing this module doesn't do?! Can it make the tea!?
  12. Which leaves me desperately trying to find a reason why someone would use my method over the module... and the oooonly thing I can think of is my method uses the page field to create the new redirect which means if the new url should change then my redirection would change with it stopping the link from breaking. That's preferable for me. Could it be added to the module as an option instead of the freetext url redirect? Would anyone else want this?
  13. So I installed the redirect module but looking into the config I see this: class ProcessRedirects extends Process { public static function getModuleInfo() { return array( 'title' => 'Redirects', 'summary' => 'Manage redirects', 'href' => 'http://processwire.com/talk/index.php/topic,171.0.html', 'version' => 100, 'permanent' => false, 'autoload' => true, 'singular' => true, 'permission' => 'redirects-admin' ); } So I'm thinking the permission is already there? So I create a new permission page called redirects-admin and added that to a role which seemed to make the module available to users with that role. So now I'm confused, what should I add to the repository for a pull request?
  14. Occasionally though I struggle when I edit a page and want to access the field from the api but can't remember what I called it. So I have to edit the page, look up the template, work out what fields are in the template and then work out what the proper name for the field is. Unless I've missed something?
  15. Hmm. I'd best get reading. Time to learn
  16. What??? I'm going to rename this 'Redirection to maintain SEO credit the hard way lol
  17. Not a lot had I have found it first! The only advantage my method has for me, is the current site I'm doing has over 150 important links for redirection and I don't intend to do each of those myself. I share the content management jobs with the client's staff. My method means i can hand this job over to them without giving them access to other modules I wouldn't normally. Unless you can restrict user access to a per module basis?
  18. Like a lot of people, processwire sites I work on started life in other CMSs like Joomla and Wordpress where they've outgrown the scope of CMS with clients asking for more and more bespoke content. For some of my clients, SEO is a big issue as we've spent year's building up these strong pages. When creating a new site in processwire the url structure can be vastly different from the original site meaning search engines will mostly have broken links damaging the sites ranking. There's many other techniques to achieve this such as using htaccess but that can become very complicated and way to complex for most clients to manage themselves so I use this technique. I create a template with two fields, title and redirect. 'redirect' is a page select field. The title must match the url of the old page and the redirect is as you might guess, the page to redirect to. You can build up the url with parent and child pages to match the old site url. My template looks like this: <?php /* * Template: redirectPage * * Used to redirect URL adress to other page with 301 HTTP code */ $session->redirect($page->redirect->url); ?> The 301 let's google know that the page has permanently moved. See here for their explanation. Then, just work your way through your pages and URLS. See this little screenomatic for a visual. Screenomatic youtube
  19. I think I was getting pickled looking for the cookie when I actually WAS a guest! A little bit of clear thinking helped. I think it's doing it's job correctly. And yes, I'd also forgotten to change the isset variable. Next job will be to start collecting the cookies ready to add to the audit when the user is next logged in. <?php $this_page = $page->id; if ($user->isGuest()) { $youloggedin = "you a guest"; } else { $youloggedin = "you not a guest";} $today = date("Y-m-d"); if ($user->isGuest()) { setcookie($today, $this_page, time() + 500); if (IsSet($_COOKIE[$today])) { $cookiepageid = $_COOKIE['pageid']; } } ?>
  20. I'm trying to drop a cookie when a page is viewed when the user is not logged. I've tried using Isloggedin {}else{do this} but that didn't work. It just kept on dropping the cookies regardless. So I also tried if ($user->isGuest())... but that doesn't seem to work either.. it just keeps on with the cookie. Maybe I'm using it wrong? <?php $this_page = $page->id; if ($user->isGuest()) { setcookie(date("Y-m-d"), $this_page, time() + 500); if (IsSet($_COOKIE['pageid'])) { $cookiepageid = $_COOKIE['pageid']; } }
  21. davo

    Page Audit

    Odd, using the admin gui I can't add or delete row entries, but the api is still able to add rows. I'm logged in as a super user so access shouldn't be an issue. On your version of this, did you use exactly the same field names as I have above? Even the date field? Yes, I'll probably move this to vip for ryan.
  22. davo

    Page Audit

    Adrian In the table field, I've tried to use the trash can to clear out some of the entries, it puts a line through the entry but when I come to save it, it doesn't delete the entries. I've used the same field titles as above. Do you also get the same issue?
  23. Thanks anyway. Got there like this in the end.. think it works:) <table class="table table-striped"> <thead> <tr> <th>Visit Date</th> <th>User Roles</th> <th>User Name</th> <th>Page ID </th> <th>DMC Page</th> <th>Country</th> </tr> </thead> <tbody> <?php $durole = "du"; // this is the role that I want highlighted in the rows $agentrole = "agent"; foreach($page->visit_log as $visit_log_item) { $username = $users->get($visit_log_item->user_id) ; $pagename = $pages->get($visit_log_item->page_id); if ($username->hasRole($durole)) { $row = "info"; } elseif ($username->hasRole($agentrole)) { $row = "danger" ;} // if the user has the durole which is called du the the table row should be success else info echo "<tr class='$row'>"; echo "<td>$visit_log_item->date</td>"; echo "<td>{$username->roles}</td>"; echo "<td>{$username->name}</td>"; echo "<td>$visit_log_item->page_id</td>"; echo "<td>{$pagename->name}</td>"; echo "<td>{$pagename->DMC_country_represented->name}</td>"; echo "</tr>"; $row = "active"; } ?> </tbody> </table>
  24. I'm sure this is about to be one of those head banging moment which I suffer so much, but I'm trying to add some styling to a row if the user identified on that row has the 'du' role. At the moment every row styles as success but you'll see from the table that shouldn't be the case. <table class="table table-striped"> <thead> <tr> <th>Visit Date</th> <th>User Roles</th> <th>User Name</th> <th>Page ID </th> <th>DMC Page</th> <th>Country</th> </tr> </thead> <tbody> <?php $durole = "du"; // this is the role that I want highlighted in the rows foreach($page->visit_log as $visit_log_item) { $username = $users->get($visit_log_item->user_id) ; $pagename = $pages->get($visit_log_item->page_id); if ($username->hasRole($durole)) { $row = "success"; } else { $row = "info" ;} // if the user has the durole which is called du the the table row should be success else info echo "<tr class='$row'>"; echo "<td>$visit_log_item->date</td>"; echo "<td>{$username->roles}</td>"; echo "<td>{$username->name}</td>"; echo "<td>$visit_log_item->page_id</td>"; echo "<td>{$pagename->name}</td>"; echo "<td>{$pagename->DMC_country_represented->name}</td>"; echo "</tr>"; } ?> </tbody> </table> 2014-08-05 37|38 david 1312 aim-group-austria austria 2014-08-05 37|2107 agent 1100 belgium-dmc-incentive-conference-and-event-management belgium 2014-08-05 37|38 david 1312 aim-group-austria austria 2014-08-05 37|38 david 1312 aim-group-austria austria 2014-08-05 37|2107 agent 1228 green-route-south-africa south-africa 2014-08-05 37|2107 agent 1228 green-route-south-africa south-africa 2014-08-05 37 guest 1165 risbecker-norway norway 2014-08-05 37 guest 1223 unitours-maroc-morocco morocco 2014-08-05 37 guest 1343 tour-east-indonesia indonesia 2014-08-05 37 guest 1294 incentive-travel-meetings-atlanta-usa-atlanta atlanta role 'du' has a page id of 1067 which isn't included in any of the above users
  25. I'm going to have to start working earlier in the evening. cheers
×
×
  • Create New...