I want to Linkify Something

I want to start off by apologizing before I even start because I’m not even sure what I’m asking for.
So I ask for you to please be patient with me and I will do my best to communicate what the problem is.

I think it has to do with Linkify. And from what little I can discern, Linkify is a Javascript plugin so, I’m asking it in the Javascript forum. I know very little about coding and even less about Javascript.

Now, what I want to do –
I have a little image hosting site I set up with a script called Chevereto. All-in-all a pretty decent platform.
When you upload an image you have some meta boxes you can fill out. One of which is a text-box you can add a description of the uploaded image. What I would like is to be able to add hyperlinks in the descriptions. This feature has apparently been disabled by the author.
But… supposedly it is possible to achieve what I’m asking for with the magic tool called Linkify. There is even a link with it in operation here.
And yes - I have asked at the Chevereto support forums on how to do it. Let’s just say the author has been less than helpful to say the least.
So can someone help me here? Here is some of little bit of info I could get.

Here is an answer I found in a similar question posted:

I’ve disabled that on descriptions to avoid robots posting stuff. That said, the only way you enable those is copying the code that you will find in user.php

And here are the direct answers to what I asked

Again, by default the system don’t link stuff. You can use the function at views/user.php to display links. Which function? G\linkify($var)

and when I asked for a little more specific answer:

No, image.php
Linkify the description using that link.

So as technically challenged as I am could someone please tell me what the heck he is saying?

Hi Philbeaux welcome to the forum

The author has given you “clues”

How familiar are you with the source code?

I don’t have the time to search through the files, but if you can locate what he’s referring to I’ll take a look at it.

That first link you cited, that’s me. I posted it.

I have searched through the code, both the user.php and image.php. I saw NOTHING even resembling what his answers said. Nothing. That string he gave, the G\linkify($var), I see nothing anywhere.
The only thing I did see was in the functions.php. There was something about Linkify. I’ll copy and paste it.

// Linkify stuff to the internal redirector
function linkify_redirector($text) {
	return G\linkify_safe($text, ['callback' => function($url, $caption, $options) {
		return '<a href="' . get_redirect_url($url) . '" '. $options['attr']. '>' . $caption . '</a>';
	}]);
}

I don’t know what any of it means or how to use it.

Maybe you should consider hiring a resource on a freelance website like upwork.com rather than meddling with code you don’t understand and breaking everything. You are bound to create more problems than you will solve copying and pasting comments / recommendations from people who don’t have any stake in your business.

Seriously, what fun would that be???

There’s a series of linkify_ functions starting at line 409 in here: https://github.com/Chevereto/Chevereto-Free/blob/master/lib/G/functions.php

The problem I have is that it would take me considerable time that I don’t have to become familiar with all of the code well enough to know where and how to change it to add a feature to it.

A problem you’re having is that the author is providing help from the perspective that you are familiar with his code, and code in general, well enough to know what he means and how to make changes to it.

If you wish to pursue this I think there are two ways to go about it.

  • politely ask the author not for what coding is needed but what files to look in
  • look through all of the files until you see something that looks like it is involved with what you’re interested in changing

The first hasn’t gone so well and it looks like the author has provided as much help as he’s willing to. That leaves the second.

Well the author actually broke it down for me and showed me what to do. Turned out it was pretty simple. And, in my defense, before I posted here I was doing exactly what you suggested - looking through the files. I was even using Web Developer to inspect the HTML. Turned out I was very close but I was incorrectly trying to call the Linkify function.
But thanks for the input. But don’t go far because I’m sure I’ll have more questions in the future.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.