Jump to content

Lance O.

Members
  • Posts

    371
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Lance O.

  1. This happened to me when using the jQuery Cycle 2 plugin. If I remember correctly, the images were displaying in the same order they were loading into the page, so the order was different for different users. A simple script setting adjustment fixed the problem. The great thing about problems like this is that once you've spent time discovering the solution, you at least know what to look for if you manage to make the same mistake!
  2. How can I add fields to the user page in the PW Admin? I'd like to add a field for a user's full name. The blog profile created by Ryan uses a similar field named "Display name (first and last name)," but I can't figure out how that field is added to the page. I've combed through the forum and I can't find the answer to my question. Is this something done through the PW Admin or through a script?
  3. It works perfectly now with that tiny edit. Thanks for the insight, Ryan!
  4. @ryan, Sorry, I should have provided the code that I am using from your Blog site profile. I'm not sure where I would add the "start=0." function getArchives( $year = 0, $limit = 0 ) { if ( $year ) { $firstYear = $year; $lastYear = $year; } else { $oldest = wire('pages')->get( "template=post, date>0, sort=date" ); $newest = wire('pages')->get( "template=post, date>0, sort=-date" ); if ( !$newest->id ) return ''; $firstYear = date('Y', $oldest->getUnformatted('date')); $lastYear = date('Y', $newest->getUnformatted('date')); } $_limit = $limit > 1 ? (int) $limit : 2; $years = array(); for ( $y = $lastYear; $y >= $firstYear; $y-- ) { $months = array(); $numPostsYear = 0; for ( $month = 1; $month <= 12; $month++ ) { $firstDay = strtotime( "$y-$month-01" ); $lastDay = strtotime( "+1 month", $firstDay ) - 1; $posts = wire('pages')->find( "template=post, date>=$firstDay, date<=$lastDay, limit=$_limit, sort=-date" ); $numPosts = $posts->getTotal(); if ( !$numPosts ) continue; $numPostsYear += $numPosts; $months[$month] = array( 'url' => wire('config')->urls->root . "blog/archive/$y/$month/", 'name' => strftime('%B', $firstDay), 'posts' => $limit > 0 ? $posts : array(), 'total' => $numPosts ); } if(!$numPostsYear) continue; $years[$y] = array( 'url' => wire('config')->urls->root . "blog/archive/$y/", 'name' => $y, 'total' => $numPostsYear, 'months' => $months ); } return $years; } function renderArchives(array $years) { $out = ''; foreach ( $years as $year ) { $t = new TemplateFile(wire('config')->paths->templates . 'includes/archives.php'); $t->set('year', $year['name']); $t->set('total', $year['total']); $t->set('months', $year['months']); $t->set('url', $year['url']); $out .= $t->render(); } return $out; } $archives = renderArchives(getArchives());
  5. I'm using the getArchives() and renderArchives() functions found in the /templates/archives.php file from the Blog Profile developed by Ryan. These functions are used independently of the blog profile and have been added to a site that has already been developed in PW. The year/month archive listing in the sidebar work fine on all blog pages expect for pages that are paginated. I'm thinking that the additional URL segment is throwing things off, but that's just a guess. Has anyone had any experience with displaying a date-based archive listing of blog posts? The listing needs to be structured like this: 2011 > January (1) 2010 > June (2) > July (1) > November (1) 2009 > November (1) 2008 > February (1) 2006 > January (1)
  6. Thank you, kkoala! That tiny little modification did the trick. I'd rub your fuzzy little belly if I could! Hopefully the documentation can be updated so no one else has to experience the same issue.
  7. I'm working on a simple blog that requires date-based archives and I'm having a difficult time wrapping my head around pagination with urlSegments. I've modified Marty's code from this post: http://processwire.com/talk/topic/1356-news-section-archives/?p=12313 My modified code: $thisyear = date("Y"); $year = (int) $input->urlSegment1; $blog = $pages->find( "parent=/blog/, template=post, limit=2, sort=-date, date>=$year-01-01, date<=$year-12-31" ); foreach ( $blog as $blogitem ) { $str = "{$blogitem->date}"; $publishyear = strtotime( $str ); $urlyear = date( "Y", $publishyear ); echo "<h2><a href='{$blogitem->url}'>{$blogitem->title}<span class='date'>{$blogitem->date}</span></a></h2>"; echo "<p class='summary'>{$blogitem->summary}</p>"; } My code for pagination: $pagination = $blog->renderPager(array( 'numPageLinks' => '10', // Default: 10 'getVars' => '', // Default: empty 'baseUrl' => '', // Default: empty 'listMarkup' => "{out}", 'itemMarkup' => "{out}", 'linkMarkup' => "<a href=\"{url}\">{out}</a>", 'nextItemLabel' => 'Next', 'previousItemLabel' => 'Previous', 'separatorItemLabel' => '', 'separatorItemClass' => '', 'nextItemClass' => '', 'previousItemClass' => '', 'lastItemClass' => '', 'currentItemClass' => 'current' )); echo '<div id="posts-nav">' . $pagination . '</div>'; My blog structure looks like this: http://domain.com/blog/archive/2010/11/ And should look like this when paginated: http://domain.com/blog/archive/2010/11/page2/ But instead looks like this: http://domain.com/blog/archive/page2 The year and month segments aren't being written into the pagination links. I've read the documentation on pagination and scoured the forum for an example of how to get this to work, but I haven't had any luck and am at a loss at this point. I'd really appreciate it if someone could point me in the proper direction.
  8. I knew it had to be something simple. Thanks for contributing a fresh set of eyes on my silly mistake.
  9. I'm currently working on a site that includes a blog. Individual blog posts can be assigned multiple "categories" using a Page field type in the post that references pages using the "category" template. When I perform the following, the correct posts are displayed on each category page: $posts = $pages->find( "parent=/blog/, template=post, categories=$page->name, start=0, limit=20, sort=-date" ); But, when I modify the code to limit the number of posts that are displayed, the same two posts display on every paginated page within a category: $posts = $pages->find( "parent=/blog/, template=post, categories=$page->name, start=0, limit=2, sort=-date" ); My "category" template is set to "Allow Page Numbers" and the pagination is displaying on each paginated category page. But any posts beyond the first two never display. It has been a long working Sunday and I'm sure that whatever I'm doing wrong is silly, but I'm too tired to see it!
  10. Whoops, nevermind! I just discovered the "More Search Options" button on the "Member List" page.
  11. Is there a way to search for PW forum members by location? I'm interested in finding other PW developers in my local area.
  12. @3fingers Sorry, I haven't had a chance to start this side project.
  13. EDGE is a responsive site designed by Salvato + Coe Group and developed by myself: http://edgela.com/
  14. Thank you for your responses. The consensus is the site should be hosted at *.processwire.com. Since others are now purchasing domain alternatives and there were no offers to contribute to the design and development of the site, I'm going to back down on this idea. But thank you for your valuable input.
  15. I'd like to set up a site that showcases projects built with ProcessWire. As an full-time independent developer, I'm hoping a site like this will promote ProcessWire and help persuade clients into using ProcessWire for future projects. My current favorite inspirational showcase site is http://www.siteinspire.com/ With that being said, I have a few questions for the ProcessWire community: 1. Is this a good or bad idea? Has anyone already started something similar? 2. Does this step on Ryan's or the official ProcessWire site's toes? 3. Would you submit your projects to a site that isn't officially maintained by Ryan? 4. I've purchased several possible domains. Is there one you prefer more than the others? builtwithprocess.com builtwithprocesswire.com madewithprocess.com madewithprocesswire.com 5. If you think this is a good idea, what features would you like to see on the site?
  16. Thanks, Ryan. Is this information on the install screen new to ProcessWire 2.9? If not, how could I have missed it?
  17. Which of the following are the minimum MySQL database user privileges required by ProcessWire? ALTER CREATE CREATE ROUTINE CREATE TEMPORARY TABLES CREATE VIEW DELETE DROP EXECUTE INDEX INSERT LOCK TABLES REFERENCES SELECT SHOW VIEW TRIGGER UPDATE
  18. Excellent advice. Looks like I will be developing my first ProcessWire Module!
  19. Does ProcessWire have include the ability to automatically send a welcome message to new users when their account is created? I'd like to send new users their login information, as well as some helpful links related to ProcessWire and their project. Ideally, I'd like to be able to edit the message. Currently, I have the following set up in TextExpander. The capitalized words are changed using TextExpander's fill-in functionality. Dear EMAIL, Your new site has been successfully set up at: http://DOMAIN/ You'll use ProcessWire to manage your site's content. You can log into your administrator account with the following information: http://DOMAIN/processwire/ Username: USERNAME Password: PASSWORD (case-sensitive) Need to reset your password? Click on the 'Forgot your password?' link on the login page: http://DOMAIN/processwire/ Learn how to create a strong and secure password: http://www.google.com/goodtoknow/online-safety/passwords/ What makes ProcessWire so great? Learn about the set of features designed to make working with your content easy and enjoyable: http://processwire.com/ Find out what makes ProcessWire unique from other content management systems: http://processwire.com/about/what/ We hope you enjoy your new site!
  20. I think it is a good alternative to the client who only has a budget for a desktop site, but wants to later add a mobile site. Instead of redeveloping the desktop site using responsive web design (one of my personal nightmares), it would be much easier to just develop a mobile responsive site at a different domain.
  21. I've got a proof of concept up and running. (Note that I will probably take this down at some point, so apologies ahead of time for any broken links.) Desktop site: http://prcss.info Mobile site: http://m.prcss.info If you visit the desktop site on a mobile device, you should be automatically forwarded to the mobile site. I'm using the detection script mentioned earlier in this thread. The detection script is only installed on the desktop site. Notice that the "Desktop Header/Desktop Footer" text changes to "Mobile Header/Mobile Footer" depending on the domain from where you are viewing the site. I used Soma's code to switch out the header and footer. I've added an image and internal link to the Home page to make sure that those links work correctly on both sites. To point the subdomain to the main domain, I changed the Document Root in cPanel to /public_html A BIG thanks to Soma for pointing me in the proper direction. As with all things ProcessWire, the best solution is usually the easiest.
  22. @Marty Walker Yes, just using a PHP detection script. There are several mentioned in the book Mobile Design and Development, one of which is mobile device detect.
  23. @Soma Interesting. I didn't think it would be this easy. I'll have to set something up and share my experience. Thanks for your quick response.
  24. Is the following concept possible using ProcessWire? 1. The mobile version of a site would reside at m.exampledomain.com and the desktop version at exampledomain.com 2. The mobile version would use responsive web design, and the desktop version would not. 3. The mobile version would have a limited experience, displaying less content and functionality than the desktop version of the site. 4. Both sites would use a single database, maintained using only one ProcessWire Admin. There wouldn't be a set of separate fields for each site; instead both sites would use the same set of fields from the same single database. 5. Each site would use a different set of ProcessWire templates. The concept here is that the client maintains the desktop version and the content is used in two sets of templates (mobile and desktop). This is different than using responsive web design and presenting the same set of templates differently for both mobile and desktop.
×
×
  • Create New...