TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 317
  • Total: 317

[Block] Linkit - A member submittable links block

Started by Thurnok, August 02, 2006, 10:01:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thurnok

Yea.. sometimes members just need a little "prodding".  hehe

Sledge

#71
Quote from: brianjw on December 29, 2006, 11:29:02 PM
When adding links:
-Is there a way I can add a little image instead of text for only some of them.

For the URL name use a html image tag as follows:

<img src="http://wwwimage.cbsnews.com/images/2006/12/27/image2299925g.jpg" width="80" height="80">

My question is: is it possible to limit the amount of links that can be posted, with the older links "automatically" falling off and being removed from the database?

lookseego

Quote from: Sledge on January 01, 2007, 01:34:24 AM
Quote from: brianjw on December 29, 2006, 11:29:02 PM
When adding links:
-Is there a way I can add a little image instead of text for only some of them.

For the URL name use a html image tag as follows:

<img src="http://wwwimage.cbsnews.com/images/2006/12/27/image2299925g.jpg" width="80" height="80">

My question is: is it possible to limit the amount of links that can be posted, with the older links "automatically" falling off and being removed from the database?


Yes, I too would like to know, if there is a limit we can put??

hygron


Sledge

QuoteMy question is: is it possible to limit the amount of links that can be posted, with the older links "automatically" falling off and being removed from the database?

The reason I ask is because I use Linkit to show news links (have a look: http://www.politipoll.net). I add several links a day, but also have to delete all the old ones by hand. Even if the radio buttons could be made check boxes so I can delete all the old posts at once, that would be just as helpful.

Thurnok

Well, to add removing links that are "old", would require adding a date/time stamp to the table.  Probably a variable to determine what constitutes "old", then parsing the table on each view to see if any links "qualify" to be removed.  Possibly a future update.

Another option would be to limit the number of links to "x", then dropping the "total links - x" links with the lowest IDs.

Sledge

Hmm, yea, I'm diggin it. But what if we used checkboxes instead of radio buttons? That way I could delete a bunch of links at once instead of going through them one at a time? I dinked with the code and managed to get it to use checkboxes instead, but it still only deleted the oldest link.

Thurnok

Well, the issue with using checkboxes is that another mechanism would then need to be used for "editing" a link entry vice deleting one.  In otherwords, you check 5 checkboxes out of 100 links, then click "Edit" - you are going to change all 5 to the same URL or the same Description?  Obviously that would not be a desirable result.

When I initially created this block, I used small buttons (2 of them, one edit button, one delete button) next to each link that you clicked to perform the desired action.  Unfortunately, IE has problems with the BUTTON tag (submit won't work properly because you need the ID of each link item to be returned as the button's variable result, but submit button result is the same as the button's text display - an ugly thing to do).  So I changed it to a radio button next to each link and a single Edit and Delete button for operating on the seleted link.

So to keep it as user friendly (and admin friendly), this worked out the best.  However, I'll look into changing the radio buttons to checkboxes, and adjusting the code to work properly depending on if you select to Edit or Delete.  This might take a back-seat however to some other projects that I'm way behind on now, so might be a bit before I can get to it.

Sledge

Take your time, you've done plenty already. Thanks for the info and a great block. It's the centerpiece of the frontpage of my forum.

Thurnok

Quote from: Sledge on January 01, 2007, 01:34:24 AM
Quote from: brianjw on December 29, 2006, 11:29:02 PM
When adding links:
-Is there a way I can add a little image instead of text for only some of them.

For the URL name use a html image tag as follows:

<img src="http://wwwimage.cbsnews.com/images/2006/12/27/image2299925g.jpg" width="80" height="80">

My question is: is it possible to limit the amount of links that can be posted, with the older links "automatically" falling off and being removed from the database?

Sorry breezed over this and missed this...  Yes, you "can" do this, but remember that you need to adjust the max size of the description text in the code.  Using an img tag will generally need much larger size than what you actually want to allow for descriptions (especially for a left or right block) so your users may accidentally (or intentionally) use rather long descriptions (because the limitation is for all users).

In other words, you can make the description text max size 50 or 100 so you can accommodate long urls for the img tag and such, but this would mean that any user that you've given access to "add" links can use up that 50 or 100 text space as well with just text.  This might make your Linkit block a bit visually unappealing with all the long description text for various user submitted links if you are using a left or right block since they are usually small width blocks.  The text will wrap, but this means you could have 3, 4, or longer lines used for a single link.  Guess you just need to keep your members in check with this.

One other thing to be aware of... if your users use the img tag, they can display any image there, regardless of its nature, size, etc.  So you could get undesirable results like porn pictures, or overly large images that totally mess up your page layout.  So, the moral of the story here is, to use with caution.  Limiting the description to 20 or 30 characters generally prevents "most" of the issues since it is difficult to use an img tag with so few characters available due to URL text lengths and such.

In the future, I might add image support where you can allow members to submit an image instead of a text description, but where the block will limit the image dimensions to an Admin setting so you can control the size of the images.  As far as the actual content of the image, the only solution there would be an approval system where the admin would need to approve the image before the link shows up.  Not sure whether I want to go there or not at this point.  We'll have to wait to see what will be turning out for the TinyPortal Links module.

This website is proudly hosted on Crocweb Cloud Website Hosting.