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: 321
  • Total: 321

[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.

Gargoyle

Very cool !!!

Works if placed in a php article as well.. Thanks a million for this!!

Thurnok

Quote from: zillion on August 10, 2006, 12:58:36 AM
Hmm.  Getting an error message: "Unexpected error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"

Well, typically that error has to do with not authenticating to the MySQL server.  If your SMF and TinyPortal are working correctly however, this should not be the case.

Did you have any other errors prior to putting in the Linkit block?  Try removing the Linkit block, clear your forum errors so it is empty, then manuever around in TP and SMF selecting different options and return to see if you have any other errors listed in your admin control panel.

Also, what version of PHP and MySQL is your server running? And what version of SMF/TinyPortal?

I probably should have stated (and I will update the first post to state so) that this has been tested in SMF 1.1 RC2 w/ Tiny Portal 0.86 by myself.  I don't know if some others have tried it in different flavors of SMF/TP successfully or not.  I tried to make it as generic as possible, but in order to use some of the built-in globals, it may be SMF specific.

zillion

#12
(For the record I'm using: SMF 1.1 RC2, Tinyportal 0.8.6, PHP 4.3.1 and MySQL 4.1.11)
STEP ONE: Deleted Block, cleared Error Log, furkled-around and inspected Error Log.  One entry shows:

Today at 13:59
http://ccgi.zillion.plus.com/netsandedges/index.php
8: Undefined index: prepend
File: /files/home3/zillion/MMM/libraries/lib-view-zone.inc.php
Line: 288

This seems to relate to my Adserver (Max Media Manager)    

STEP TWO: Cleared Error Log, reinstalled block, inspected error log and it now shows three errors:

Today at 13:59
http://ccgi.zillion.plus.com/netsandedges/index.php
2: mysql_query(): A link to the server could not be established
File: /files/home3/zillion/netsandedges/Themes/TPAmberRC2/TPortal.template.php (eval?)
Line: 177
   
Today at 13:59
http://ccgi.zillion.plus.com/netsandedges/index.php
2: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
File: /files/home3/zillion/netsandedges/Themes/TPAmberRC2/TPortal.template.php (eval?)
Line: 177
   
Today at 13:59
http://ccgi.zillion.plus.com/netsandedges/index.php
8: Undefined index: prepend
File: /files/home3/zillion/MMM/libraries/lib-view-zone.inc.php
Line: 288



Thurnok

Hmm... it almost looks as though you might have another php block somewhere that is making some MySQL calls and then at the end of it, closes the connection (i.e. mysql_close($link) somewhere near the end of it).  I'm not sure about the order index for blocks (going by creation date, or positional) but I would start by looking at the last php block you made prior to the Linkit block and see if it has a mysql_close() function in it.

In the mean time, I'm looking through my code for any inconsistencies or errors that might cause your issue under some sort of circumstances.

Thurnok

I'm reminded of that old children tune that goes something like "Conjunction junction... what's your function?  ... putting AND, BUT, and OR, together to make them function..."

Problem: Adding links where you put the full URL including the "http://" part caused the link to show up as "http://http//<some link>".  The Edit feature worked correctly however.

Resolution: Mistakingly used an OR (||) instead of an AND (&&) in the Add link function - got my conjuctions mixed up ;)
heh.. fixed code in original post

zillion

Quote from: Thurnok on August 11, 2006, 09:08:51 PM
.. you might have another php block somewhere that is making some MySQL calls and then at the end of it, closes the connection (i.e. mysql_close($link) somewhere near the end of it).
I do have two other php blocks, but neither has the mysql_close function in the script.

yj98

I got the error info below:
QuoteNot Found
The requested URL /forum/forum/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I noticed the error : URL /forum/forum/index.php seems duplicated.

Ps: My forum installed in Http://mydomain.com/forum

What should I do know ? thanx

Thurnok

Quote from: yj98 on August 12, 2006, 02:40:34 PMI noticed the error : URL /forum/forum/index.php seems duplicated.

Ps: My forum installed in Http://mydomain.com/forum

What should I do know ? thanx
FIXED:  New code posted in original post.

If you weren't using the root of the domain as your forum location, you would receive that problem.  It should be corrected now, check it out and let me know.

Additionally:  Added two denial arrays.  You can now list groups that if a member is in, they are denied the ADD/EDIT/DELETE access regardless if they are in a previous group that was authorized.  You can also deny individual users access regardless if they are in a group with access or not.  Both are in the configuration area of the snippet and are arrays like the others.

yj98

Yes. Cool. Its working . Thanx . Keep up good code. Thurnok.

Here's My front-page: http://irpsoft.com/forum

yj98

But another issues is coming . No member except ADMIN could add link, even Global moderator cannot.

This website is proudly hosted on Crocweb Cloud Website Hosting.