Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/28/2012 in all areas

  1. I'm trying this out and had the same problems. Fixed it by replacing this... next_image => '?img='.$nextImage->name, prev_image => '?img='.$prevImage->name, ...with... next_image => $nextImage->name, prev_image => $prevImage->name, And then changing the code that generates links from... else{ $image = singleImage($page,$sanitizer->name($input->get->img)); echo "<div class='image-gallery'>"; echo "<div class='image-controls'>"; echo "<table><tr>"; echo "<td class='image-prev'>".(!$image->next_image ? "<a href='".$image->next_image."'>":"").$labels->prev.(!$image->next_image ? "</a>":"")."</td>"; echo "<td class='image-thumbs'><a href='./'>".$labels->thumbs."</a></td>"; echo "<td class='image-next'>".(!$image->prev_image ? "<a href='?img={$nextImage->name}'>":"").$labels->next.(!$image->prev_image ? "</a>":"")."</td>"; echo "</tr></table>"; echo "</div>"; echo "<div class='image-viewer'>"; echo "<img src='".$image->url."' />"; echo "<div class='image-description'>".$image->description."</div>"; echo "</div>"; echo "</div>"; } ...to... else{ $image = singleImage($page,$sanitizer->name($input->get->img)); ?> <div class='image-gallery'> <div class='image-controls'> <table><tr> <td class='image-prev'><?php if ($image->prev_image) echo "<a href=\"?img={$image->prev_image}\">{$labels->prev}</a>"; else echo " " ?></td> <td class='image-thumbs'><a href='./'><?= $labels->thumbs ?></a></td> <td class='image-next'><?php if ($image->next_image) echo "<a href=\"?img={$image->next_image}\">{$labels->next}</a>"; else echo " " ?></td> </tr></table> </div> <div class='image-viewer'> <img src="<?= $image->url ?>" /> <div class='image-description'><?= $image->description ?></div> </div> </div> <?php } YMMV.
    2 points
  2. hi guys. just starting out using PW and loving it so far. incredible work, Ryan! i haven't used CMSs too much in the past, but tried out enough and researched enough to know that PW is awesome and just makes simple sense in so many ways. i've been reading a lot about PW, but i can't seem to find any example of the best practice for creating global "shared" content, like for example, a footer with contact info to be the same across all pages. i have 1 idea, but not sure if it's the preferred method - i want to start out using the right method. should i do this, or something else? create a "footer" template and page, make the page status Hidden so it doesn't show up in navs, etc, and pull content from it to all pages using something like: $footer = $pages->get("/footer"); echo $footer->body; // or maybe better yet (i'm just starting out, i think this is the shorthand): echo $pages->get("/footer")->body; or am i missing a key concept of how to do this a different way? and, on a related note: would i do something similar if i wanted to have a "settings" page where the user would fill in things like their Facebook page URL, Twitter name, etc.? then wherever i had a Facebook logo to link to FB or a Twitter logo to link to Twitter, i'd pull in that field from the "settings" page like this? echo $pages->get("/settings")->twitter_name; your help is very much appreciated. thank you!
    1 point
  3. Hi Scott! Welcome to the forum! There isn't really a right way. One of the good things about PW is that it lets you create your own way of doing things. With that said, I think you are on the right track. You can create a settings page, with a settings template, and do exactly as you showed on your template file. The best way would be creating the "settings" template without creating a template file, since you will output the content through other files. For the footer, you can also do like you said, but I would keep it more semantic, like - instead of calling it footer, I would call it contacts, and copyright, and people... you get it
    1 point
  4. I've been quite busy last few months (and still am), but I managed to squeeze new admin theme called Futura Remixed (successor to my Futura theme). So let's get started: complete rewrite of the theme complete new graphics, includin PageList tree icons etc. full multi-language support (except "You are logged in as", "Latest updates" and "Newest added" title (could be done by implementing those in language packs I suppose) complete new TinyMCE theme with Fugue icons (that was pain in the ass) integrated CodeMagic TinyMCE plugin that uses CodeMirror to highlight the code and HTML beautifier to beautify the code (unlike plain TinyMCE HTML editor) AdminBar theme How to install: Unpack FuturaRemixed.zip to your /site/ directory Replace /wire/modules/Inputfield/InputfieldTinyMCE directory with InputfieldTinyMCE directory contained in the attached InputfieldTinyMCE.zip file Extract AdminBar.zip to your /site/modules/AdminBar directory (if you use it) I've tested the theme thourougly but errors may still show up. So if you find them, please let me know, so I can fix them. When I get time, I'll update this theme with colors from original Futura theme so you could choose between them. Let's look at the screenshots: Enjoy the theme as much I've enjoyed making it. AdminBar.zip FuturaRemixed.zip InputfieldTinyMCE.zip
    1 point
  5. Hi! This is my first post here ;-) I solved the issues mentioned by Soma by editing bootstrap.css. Go to /wire/templates-admin/styles/bootstrap.css Remove or comment line 2063 to 2087 (.modal class) and replace it by: body.modal { background-position: 0 -60px !important; } body.modal div.topbar, body.modal ul#breadcrumb { display: none; } body.modal div.container-fluid { min-width: 300px; } body.modal div.container-fluid > div[style] { padding-top: 15px !important; }
    1 point
  6. ReCaptcha used to be a bit easier to read for humans - now I usually have to get it to refresh a few times before I can read one as it's got a bit silly lately.
    1 point
  7. Thanks! Well, I must say, very good CMS framework! Now I have changed and cleaned! <?php /** * Image gallery v.0.2 template * named bildgalleri.php * Created by Max Allan Niklasson a.k.a. rödgladan * Share and use! */ $labels = (object) array( 'subAlbums' => 'Album under', 'subPictures' => 'Foton under', 'prev' => 'Föregående', 'next' => 'Nästa', 'thumbs' => 'Miniatyrer' ); //breakLine after x-numbers loops function ImageGallery(Page $page,$breakLine=4){ $return_alb = Array(); $return_img = Array(); $numberImages = count($page->images); $numberPages = count($page->children); //Process the albums for($i = 0;$i < $numberPages;$i++){ //To find sub images use this $subPage = $page->children('template=bildgalleri')->eq($i); //To just get the informationen of the relative sub gallery $nextPage = $page->children('template=bildgalleri')->eq($i); //The thumb to this gallery $cover = $subPage->images->first(); if(!$cover){ //If no sub images is find, digg! $coverIsDef = false; //Search of childed images, and take the first found image while($coverIsDef===false){ $whileSubPage = $subPage->children('template=bildgalleri')->first(); $cover = $whileSubPage->images->first(); if($cover) $coverIsDef = true; else $subPage = $whileSubPage; } } if($cover){ //When images is found, make thumb of it $coverThumb = $cover->size(140,140); } $linebreak = 0; if($i > 0 && $i % $breakLine == 0) $linebreak = 1; $ret = (object) Array( url => $nextPage->url, title => $nextPage->title, cover => $coverThumb->url, name => $nextPage->name, description => $nextPage->summary, linebreak => $linebreak ); array_push($return_alb,$ret); } //Process images for($i = 0;$i < $numberImages;$i++){ $image = $page->images->eq($i); $thumb = $image->size(140,140); $linebreak = 0; if($i > 0 && $i % $breakLine == 0) $linebreak = 1; $ret = (object) Array( url => '?img='.$image->name, thumb => $thumb->url, description => $image->description, linebreak => $linebreak ); array_push($return_img,$ret); } return (object) array(albums => $return_alb, images => $return_img); } function singleImage(Page $page,$image){ $images = $page->images; $image = $images->get($image); $nextImage = $image->getNext(); $prevImage = $image->getPrev(); $sizedImage = $image->size(900); if($image) return (object) array( next_image => '?img='.$nextImage->name, prev_image => '?img='.$prevImage->name, url => $sizedImage->url, description => $image->description ); } /* * * * And now, print! * * */ include("./head.inc"); echo '<link rel="stylesheet" type="text/css" href="'.$config->urls->templates.'styles/bildgalleri.css" />'; echo '<div id="bodycopy-100">'; if(!$_GET['img']){ $gallery = ImageGallery($page,3); echo "<p class='image-gallery-desc'>{$page->summary}</p>"; //Get subgalleries if($gallery->albums){ echo '<h3>'.$labels->subAlbums.' <i>'.$page->title.'</i></h3>'; echo '<table class="image-table"><tr>'; foreach($gallery->albums as $album){ echo "<td><a href='".$album->url."'><img src='{$album->cover}' alt='".$album->name."' title='".$album->description."' /><p class='table-desc'>{$album->title}</p></a></td>"; if($album->linebreak == 1) echo "</tr><tr>"; } echo "</tr></table>"; } //Get images to this gallery if($gallery->images){ echo "<h3>".$labels->subPictures." <i>".$page->title."</i></h3>"; echo '<table class="image-table"><tr>'; foreach($gallery->images as $image){ echo "<td><a href='".$image->url."'><img src='".$image->thumb."' title='".$image->description."' alt='".$image->description."' /></a></td>"; if($image->linebreak==1) echo "</tr><tr>"; } echo '</tr></table>'; } } //Image view of one image! else{ $image = singleImage($page,$sanitizer->name($input->get->img)); echo "<div class='image-gallery'>"; echo "<div class='image-controls'>"; echo "<table><tr>"; echo "<td class='image-prev'>".(!$image->next_image ? "<a href='".$image->next_image."'>":"").$labels->prev.(!$image->next_image ? "</a>":"")."</td>"; echo "<td class='image-thumbs'><a href='./'>".$labels->thumbs."</a></td>"; echo "<td class='image-next'>".(!$image->prev_image ? "<a href='?img={$nextImage->name}'>":"").$labels->next.(!$image->prev_image ? "</a>":"")."</td>"; echo "</tr></table>"; echo "</div>"; echo "<div class='image-viewer'>"; echo "<img src='".$image->url."' />"; echo "<div class='image-description'>".$image->description."</div>"; echo "</div>"; echo "</div>"; } include("./foot.inc");
    1 point
×
×
  • Create New...