Jump to content

Recent Gallery Images Block Template in IP.Content


Tripp★
 Share

Recommended Posts

File Name: Recent Gallery Images Block Template in IP.Content

File Submitter: Tripp_UK

File Submitted: 12 Feb 2014

File Category: Integration

Supported Versions: IP.Board 3.4.x, IP.Content 2.3.x, IP.Gallery 5.0.x



This is for people who've tried other solutions in putting a feed to retrieve gallery images only to have it load a in-browser resized full image not particularly do anything else.

I asked for help on the community on the 4th of February, and due to my lack of experience with IPS Code it's taken me this long to make it happen. But I can't take, and must not take credit for other peoples work and I won't. It's been a case of playing around with the code to get the desired effect, trial and error. But I eventually got it working on my site and figured if someone came across the same problem I did then they could download it here. I'm open to improving this block, and even trying to code it to IP.Suite 4 standards, I could really do with an IPS Code for Dummy's book :sad:

This will load the Thumbnails of the pictures you seek (100 x 100) and it actually loads the thumbnail files instead of the full file and scaling it down to 100 x 100 or 50 x 50. Currently it's a no frills block.

- But it does wrap using IP.Board's Category Blocks. ^_^



Instructions:
1) Import the Block Template: ACP -> Apps -> Content -> Templates -> Block Templates
2) Edit the Gallery Feed block: ACP -> Apps -> Content -> Blocks -> The Gallery Feed Block -> Step (5) Templates to use the newly imported Block Template.

Disclaimer:
I have no idea what I'm even doing. But it does work. At least it does on my installation. There is no demo or screen shots because my site is an adult one, sorry. It's free and that's how I'd like this to remain. I don't have a copyright field in there. No copyright infringement was intended.

Credits:
This is a lot like the Recent Gallery Images hook ["appGallLatestHook"] (Which I've based this off of) but I've also taken advice from this thread. Thank you Rimi and Gearnik your thread really helped me out. Big thanks to AndyF and other IPS Staff for helping me get this onto the Marketplace.



here to download this file

Link to comment
Share on other sites

  • 1 month later...

I had no idea what you're talking about, until I looked at the XML file. This was exported from my Invision Power Board installation, and thus I have absolutely no idea how I'd go about this. Once imported (In the correct place) it should be plain text when you go to edit it. Unfortunately I don't know why it's encoded, seems pointless to me. Why it's encoded; I have no idea. I assume it's something Invision have built into their export block feature for IP.Content.

Does it not work at all?

Link to comment
Share on other sites

I had no idea what you're talking about, until I looked at the XML file. This was exported from my Invision Power Board installation, and thus I have absolutely no idea how I'd go about this. Once imported (In the correct place) it should be plain text when you go to edit it. Unfortunately I don't know why it's encoded, seems pointless to me. Why it's encoded; I have no idea. I assume it's something Invision have built into their export block feature for IP.Content.

Does it not work at all?

failed on import with following system error: [#11CCSB014] No block data was present in the file you selected to import

Link to comment
Share on other sites

screenshots of the block?

Please read the disclaimer.

failed on import with following system error: [#11CCSB014] No block data was present in the file you selected to import

This is really strange. I will look into it, and see what the problem is, and I will get back to you. As far as I am aware I did not encode anything nor have I asked for it. So I will look into this as soon as I can. Are you trying to import it as a Block or a Block Template?

Link to comment
Share on other sites

  • 2 months later...

Apologies; life problems and stuff buried this from my mind. I assume the "**" was a bump or something.

I have no idea why it's encoded; I didn't ask for it to be nor do I want it to be. The reason you're getting that error; William is I suspect you're trying to add it as a block. You need to add it as a "Block Template", and you should be able to view it as such, although I suspect if its encrypted it'll probably only work on my board, which defeats the whole purpose of trying to help others.

So the code is; un-encrypted:

<style type="text/css">
#GalleryImagesIPContent {
overflow:auto;
overflow-y: hidden;
height: 100%;
}
#GalleryImagesIPContent a {
display: block;
}
 
#GalleryImagesIPContent ul li img {
max-width: 100px;
max-height: 100px;
}
 
#GalleryImagesIPContent ul li:last-child { margin-right: 10px; }
</style>
<if test="is_array( $records ) && count( $records )">
{parse js_module="gallery"}
 
<div class='category_block block_wrap'>
<h3 class='maintitle'>$title</h3>
<div id='GalleryImagesIPContent' class='ipsBox table_wrap'>
<ul class='ipsList_inline ipsList_nowrap' id='home_side_recents'>
<foreach loop="$records as $r">
<li class='gallery_tiny_box ccsPos_left ccsPad_smaller' -data-id="{$r['imgid']}">
<a href='{$r['url']}' rel='bookmark' title='{$r['title']}'><img src='{$this->settings['gallery_images_url']}/{$r['directory']}/tn_{$r['masked_file_name']}' /></a></li>
</foreach>
</ul>
</div>
</div>
<br />
Will this work for IPS4.0? I seriously doubt it.

Regardless, I hope this helps.
Link to comment
Share on other sites

Most likely not. I don't have the skill for that. I'm not a typical developer (yet) I merely tweaked a bit of existing code to make it more efficient, I never expected anyone to touch it at all. The fact is; I'm learning to program code and I have to start all way from the beginning with Python, then work my way to PHP, MySQL and JS then IPS Code. Which might take me quite a while.

If I could; I would and I'd do it for free. It's only 32 lines of code so no doubt someone could do it. Hell if no one does and I learn enough to do it; I will in a heart beat. But I don't expect it to be ready (if I am the one who's doing it) for at least a year after 4.0's release due to my study times and other commitments.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...