Image Galleries with pMachine
Comments
Hi
I had the same problem as Julian.
I changed:
<div class="thumbnail">
<a href="comments.php?id=114_0_1_0_C” title="%&#xti;tle%%">%o;dy%%</a>
</div>
to this:
<div class="thumbnail">
<a href="%o;mment_permalink%%">%o;dy%% </a>
</div>
and now it works great.
Nic
Oh, wow. I didn’t even notice that it wasn’t getting rendered correctly. Nic is quite correct, though I used %o;mments_url%%.
I’ll update the tutorial to display it correctly.
Hello Chris,
I have a quick question to you regarding the category grabbing script: I’d like the script to show a certain text, if “View All” is selected in the category dropdown field and added the following at the end of your scritp - it doesn’t work - no wonder, since I have no idea yet of PHP.
Could you please tell me how to do it? Thank you
if ($catname =="")
{
$catname = “Album: All”;
}
else
{
$catname = “Album: $catname”;
}
...not quite sure why this comment isn’t on the page for the Category Name trick, but oh well…
In the Category Grab script at the top of your file, replace } // END LEAVE THIS with:
} // END LEAVE THIS
else {
$catname = “”;
} // END ELSE
Do you know of anyway to make certain categories member’s only?
So that way some galleries will display only when a specific level of user is logged in?
I’ll investigate more on my end.. but just wondering if you had a good answer.
BlueSun, check out this thread over at the pM forums:
Member Only Categories
I think that should get you started on it.
Ok.. I looked at that recommended reading and worked a solution. I’m trying to do a member’s only gallery based on the presence of an asterix in the category name but running into problems (thought I should repost here since the category name as gallery is relevant only to your gallery idea)
So if the category name is “My Gallery*”. The Gallery is restricted to level 5 users and above… But if the name of the Gallery is “My Gallery**” I want it restricted to level 6 users and above.
I think I’m having a problem with the use of the asterix in the name as a regular expression and need help to use it as a literal. For example, assuming $catid="Gallery*" or $catid="Gallery**" in the following code, here’s what I did:
---------------code-----------------
$pattern1 = “.+**$”; //Premium Member
$pattern2 = “.+*$”;//Alpha Member
if (eregi($pattern1, $cat_id)) {
if (require_login(5)==0) {
print("You must be a Premium member to access this page.");
}
// else, they’re a member, let them in
else {
weblog_entries($id,"gallery");
}
} //If not, try to match second pattern
elseif (eregi($pattern2, $cat_id)) {
if (require_login(6)==0) {
print("You must be an Alpha member to access this page.");
}
else {
weblog_entries($id,"gallery");
}
} else {
weblog_entries($id,"gallery");
}
?>
-----------------end code------------
Any suggestions on where I messed up?
Thanks in advance
Hi Chris
Im using your tutorial, and its fantastic, Thanks heaps!
I have a problem though, I do not want comments on any of these images.
So, I deleted the content in the Comments templates, but now I am getting this:
Comments
Leave a Comment
<input type="hidden" name="post_id" value="28_0_3_0_C" title=” />
Do you know how I can remove all trace of the comments forms and the tags I am getting in my individual entry when I click on the thumbnail?
Hi Chris
Thanks for solving my comments issue.
I now have another problem.
My Multi Entry (index.php) is not generating the url for the link to the large images.
in multi-entry I have:
<div class="thumb" colspan="2"><a href="%o;mments_url%%" title="%&#xti;tle%%">%o;dy%%</a></div>
But on my page, it only generates this:
<div class="thumb" colspan="2"><a href=” “ title="another test image"><p>
<img src="http://mawson/~natalie/pmachine/images/uploads/ab.jpg" border="0" alt="image" name="image" width="95" height="95" />
</p></a></div>
see how the a href= is blank?
Do you have any ideas how I can make this work?
fixed it by changing comments_url to comment_permalink as in the above examples.
thanks chris, and thanks everyone else! you all are so helpful!
Hi Chris
Just thought I would let you know that I have slightly modified the way you have laid out the photos and text, to make it easier for others to use the photolog I have created.
Thumbnail goes in Blurb, as its small, and it suits.
Information on the image goes in Body.
Full Size Image goes in MORE.
This seems more logical to me, from an input point of view. A person uploads their thumbnail, enters information about the image, then uploads the full size image.
I find this process flow less confusing and if I havent used the site for a while, I dont have to try and remember where which image goes.
Thanks again for your fantastic tutorial, its really helped me get my head around pMachine!
ps: the other reason I did it this way, was so that I can use the exact same layout for entering text articles, without having to create a new weblog and templates ::))
Chris, could you give me the script for the images in a pop-up window, and when you click the images, the windows will close…
::
Joost
How come I don’t have the “Create New” option. I only see that option in the pBlocks section. Did I do something wrong?
Great script Chris! Like Joost I would like to use a pop up screen for the views. Could you send it to me?
Chris,
New pMachine user here - so far I think the app is great. I am running into one snag, however. I am using your tutorial as a framework for playing videos instead of showing photos, so the thumbnail creation, etc. works great. What I’m intending to do is use the thumbnail index as you suggested, use a version of the comments page to display the title, thumbnail (%l;urb%%), notes about the video (%o;dy%%), comments from other users in the same page, and a link to the “more” page (renamed PLAY) where the user can watch the video. I am using this staged display approach since videos can be large and I want the person to see the comments as a way to decide whether to download it or not.
From a template standpoint you’ve probably noted that I am varying slightly from your tutorial: I am using the %&#xti;tle%% tag to hold the title, %l;urb%% holds the thumbnail image reference, %o;dy%% holds a text description of the video, and %&#xmo;re%% holds the video reference & play tags.
SNAG: I initially set things up as you describe, then I change the multi-entry template and single-entry template to use the tags as I outlined above. When I do so I cannot get the VIEW page (based on comments.php) to use the %&#xmo;re_url%% or %&#xmo;re_link%% variables, e.g. if I do <a href="%&#xmo;re_url%%">PLAY</a> it literally tries to drop the “%&#xmo;re_url%%” into the browser’s address bar, instead of linking to the “More” page (called play.php). I also notice that the navigation link at the top of the page (by default labeled weblog, using the tag <?php return_to_weblog_or_archives_link($id); ?> points to the video index page (as it should) but with a weird parameter that leaves pMachine “hunting” (what it shows appears to be an incomplete ID, e.g.: http://nimsky.pmachinehosting.com/video/index.php?id=C0_).
Can you shed any light on what might be going on here?
Thanks in advance!
Christian Nimsky
How do I make the fullsize picture appear in a popup window? Can you make that available as pasrt of the tutorial?
Hi!
I’m trying to build a web gallery wih yout tutorial and everything works fine, except the navigation links:
I placed the tags (php next_weblog_entry($id) etc.) into the code of my “view” page, but the navigation does not “stop” at the end of the chosen category, i.e.: After reaching the last picture of category “a”, there is an unwanted link to the first picture of category “b”
Those tags are not designed to restrict by category. If you want that functionality, take a look at the Browse by Category add-on by Lynda.
Thanks!!!
After hours of testing I began thinking that I am just too stupid!
Very helpful link!
Hi Chris!
After assembling my gallery using Safari v74 I was surprised to find several other browsers being unable to display the thumbnails on the “galleries” page in the correct position (try your own with IE 5.2.2 for Mac - ok, I know it’s an evil browser, but it DOES exist!).
I found out that the CSS-Style “thumbnail” has to be completed with a “width” tag defining the horizontal size of the picture row you want to create:
.thumbnail {
border: 1px solid #000000;
float: left;
--> width: 400px (or your desired size)
margin: 3px;
padding: 3px;
I hope this information can save other people from despair after hours of work!
Hi Chris:
I’m excited about the images galleries but I am having a problem with getting the thumbnail page to render, and I was hoping you could help.
My image gallery is located at:
http://www.keelydunn.com/galleries/index.php
I’ve created a single entry in the “jo’s shower” category, at:
http://keelydunn.pmachinehosting.com/galleries/galleries.php?id=C0_17_4
You can see that if you hover near the left-hand side of the space, you’re able to click on the thumbnail that isn’t being displayed and the main image is linked to and rendered properly.
I’m thinking this might have to do with the 3-column layout I have set up in my .css file, but I’m really not sure what’s going on. I’d greatly appreciate any assistance you can provide.
- keely
Well, it seems I’ve figured it out. I added two lines to the .thumbnail divclass in my .css:
width: 400px;
position: relative;
..after I realized that other items being rendered in my center block also had the position: relative description. WHEW! /smilies/1cool.gif
...except now that I have the thumbnails being rendered, none of the rest of the php tags are. I’m stumped.
Okay, some progress has been made.
First, with all the floating elements in my .css file, I needed to add a “zdindex= x;” tag to my .thumbnail class. No problem. That helped all the thumbnails to appear in the centre block properly.
Now, the thumbnails in one category do not link properly, but in another they do - sort of. In the “good” category, the URL that appears has extra stuff at the end: “”%20title=” When I remove that manually from the URL, the page is completely correct, including the comment form that wouldn’t display before. In the “bad” category where the link from the thumbnail is broken, that “”%20title=” is all that appears behind the last forward slash - no “view.php?id=....” at all.
I must have screwed something up in the code, but I can’t fathom where. Any ideas?
Hi,
Great tutorial, I had no problems getting it to work. I would like to know if you know of a way when displaying the thumbnails to have them run across the page like 3 or 4 per row and then start a new row, instead of having 1 long running column. It would seem to be more functional in a presentational way. Thanks.
I am a newbie in website designer and programer. I have installed pmachine and want to make galleries as your.
What have I change in pm_inc.php ?
Oricginaly is
$script_directory_path = “./”;
is’t it?
Then what have I change ?
Thank you for your kindness.
Regard,
Indarta
I am a user of your image gallerie. I want to make a page who looks as:
- divide the page in two sides
- left : large pic with the comments below the picture
- right : the tumbs.
- clic the tump and you get a new page with its responding large pic and his comments.
I am traying but not able to make it. Can somebody advise me. Thanks.
Hello Chris,
I am using your image gallerie, Now I have two questions:
1. in some of the tumbnail index pages
(=portfolio and than clicking on links left)
the tumbnail do not apair in strait tows. Some times (see Anke Velstra and Joyce) there is only one tumbnail on the row. Do you know how to correct this?
2. In one of my updates the next or following scipt (and I put it conform your tutorial) is now missing? See the vieuw.php page. I am not able to show it again. Do you know how?
Thanks,
Peter van der Velde
nice job!
Hi Chris
thanks for this, I have nearly got my head round it despite only using pM since the 26th.
The one thing that has stopped me in my tracks is the hard coded link in the multi-entry template, which reads:
<div class="thumbnail">
<a href="comments.php?id=114_0_1_0_C” title="%&#xti;tle%%">%o;dy%%</a>
</div>
I do not understand this, and it does not seem to work.
Cheers and thanks for all the hard work.
By julian on December 31, 2002 at 07:09pm link