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: 445
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 414
  • Total: 414

[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

Make sure you add the membergroups you want to have Add access in the beginning of the snippet.  In the User Configurable items area:
$li_addlink_groups = array('');
This is an array that holds the membergroups ID numbers that you want to be able to "add" links.  To use it, find the membergroup ID numbers of the groups you want to give access and enter them like this example:
$li_addlink_groups = array('7', '9', '14');
The above example would give "add" access to membergroups 7, 9, and 14.

To find the membergroup numbers for each membergroup, go to your control panel, select the Membergroups menu item under the Members category, and hover your mouse over each membergroup's Modify link.  The number for that membergroup should be the last item in the link that the statusbar shows.

Thurnok

Changed HTTP_REFERER to PHP_SELF.  Seems some sites don't set the former superglobal.

Thurnok

Added a variable in the config section to set the size of the URL Name and URL Link editboxes.  Adjust as you need for your block size.

Ok, I'll do some real work next time.  ;)

Thurnok

Modified code in first post.  This will now work properly in IE, and in an Article not displayed on the Frontpage.

daftdate

Ive just put this in on my forum and its working like a dream I just need to keep an eye on it now and make sure all the links students put up are pg13.  :) little darlings that they are have a tendency to neglect their studies for things more shall we say naturallllll.   :D

Thurnok

#25
Ok... I lied when I said I would do some real work next time.  A friend of mine was using my snippet and asked for some change.  Here is the result of that.

This is the Linkit! block that you should use for either a center block or an article.  It is good if you have many links submitted by your members.

What's different:
This version creates a table of x number columns and displays the links across those columns, creating new rows as needed.  You can also modify the starting row and column tags if you like ($li_start_row and $li_start_col), for example to add your own style/font/colors/whatever.

$li_columns in the LAYOUT section of the Configuration area defines the number of columns.  Set this to your preference as looks best for your site.  I'm using 3 on one of mine, and 4 on others.  All other features are identical to the original version.

Since the layouts between this version and the original are different, I'll leave the original code in the first post and place this version's code here.

Here's the code (oh yea, place in center block as phpblock or article as php article):
REMOVED!  SEE FIRST POST


Here's a screenie of it in an Article (not on frontpage) from admin perspective:

IchBin

Nice work Thurnok! Seems a lot of people like this stuff.

Thurnok

eh... its just a simple little thing.  Unfortunately my time is spread so thin with work I rarely seem to have time for anything elaborate anymore.  But when I do get some time, I will definately make something nice.

But I'm glad its getting some use.  :)

Thurnok

To check this TP Block out, without having to install it on your own site, you can demo it at my TP blocks site: http://tpblocks.ccs-net.com

Register to get a view of both from the "user" perspective, as well as an "admin" perspective.

Thurnok

Modified original code.

Changed to go to the TP table prefix instead of the SMF table prefix since it is a TP block, not an SMF hack/mod/whatever.

If you have an existing version and are copying any new updates to this block, you should first rename your existing linkit table to fit the new name.  For example, if you left the table info using defaults it would currently be something like smf_linkit where the new name would be something like smf_tp_linkit.  In other words, smf_ prefix to smf_tp_ prefix.

Simply rename your table to the new name to keep all current link information when you use the new code from here forward.

This website is proudly hosted on Crocweb Cloud Website Hosting.