******* - Auto Link Replacer [Paid] [Deleted]

Status
Not open for further replies.

Brivium

Well-known member
Well, I don´t need a like for my problem. I need a solution.
Please try to download the latest version and upload override all files on Upload folder to your forum root. I sure it will solve your issue.

Regards,
 

DRaver

Active member
The problem is. It´s work... for the admin group.

upload_2015-2-1_10-0-28.png

But if I change the status for unregisterd users, they see only a whit page. For admin all is okay an no error.
This error happens only for guest.
 

Brivium

Well-known member
Dear DRaver,

Could you please give me the content of library/*******/AutoLink/ViewPublic/Helper/AutoLink.php file (on your hosting) ?

Regards,
 

DRaver

Active member
Code:
<?php

class *******_AutoLink_ViewPublic_Helper_AutoLink
{
    protected static $_linkCache = null;
   
    /**
     * Auto Links the given string.
     *
     * @param string $string
     * @param array|null $autoLinks Words to replace link. Null to use option value.
     *
     * @return string
     */
    public static function autoLinkString($string, array $autoLinks = null)
    {
       
        $allowCache = ($autoLinks === null); // ok to use cache for default
        $linkCache = ($allowCache ? self::$_linkCache : null);

        if ($linkCache === null)
        {
            if ($autoLinks === null)
            {
                $autoLinks = XenForo_Application::getSimpleCacheData('bralAutoLinks');
            }

            if (!$autoLinks)
            {
                if ($allowCache)
                {
                    self::$_linkCache = array();
                }

                return $string;
            }

            $linkCache = self::buildAutoLinkArray($autoLinks);

            if ($allowCache)
            {
                self::$_linkCache = $linkCache;
            }
        }
        if (!empty($linkCache))
        {
            $limitLink = XenForo_Application::get('options')->BRAL_limitLinkPost;
            try
            {
                $string = preg_replace(array_keys($linkCache), $linkCache, $string->__toString(), $limitLink);
            }
            catch (Exception $e)
            {
                $string = preg_replace(array_keys($linkCache), $linkCache, $string, $limitLink);
            }
        }
        return $string;
    }

    /**
     * Builds the AutoLink array.
     *
     * @param array $words List of words (from option format)
     *
     * @return array Possible keys: active, inactive with key-value search/replace pairs
     */
    public static function buildAutoLinkArray(array $autoLinks)
    {
        $linkCache = array();
        if (!empty($autoLinks))
        {
            $active = array();
            $replaceAtag = XenForo_Application::get('options')->BRAL_replaceATag;
            foreach ($autoLinks AS $autoLink)
            {
                $word = htmlentities($autoLink['word'], ENT_QUOTES);
                if(!$replaceAtag){
                    $search = "#(?<=\W|^)(?!((<.*?)|(<a.*?)))". preg_quote($word, '#') . "(?!(([^<>]*?)>)|([^>]*?</a>))(?=\W|$)#iu";
                }else{
                    $search = '#(?<=\W|^)' . preg_quote($word, '#') . '(?!(([^<>]*?)>))(?=\W|$)#iu';
                }
                $rel = $autoLink['rel']==0?'':' rel="nofolow"';
                $alt = empty($autoLink['alt'])?'':' title="'.$autoLink['alt'].'"';
                $target = empty($autoLink['target'])?'_blank':$autoLink['target'];
                $active[$search] = '<a'.$rel.$alt.' target="'.$target.'" href="'.$autoLink['replace'].'" title="'.$word.'" class="AutoLinkClickListener">'.$word.'</a>';           
            }

            $linkCache = $active;
        }
        return $linkCache;
    }
}
 

Brivium

Well-known member
@DRaver Please try to Find
Code:
if (!empty($linkCache))
        {
            $limitLink = XenForo_Application::get('options')->BRAL_limitLinkPost;
            try
            {
                $string = preg_replace(array_keys($linkCache), $linkCache, $string->__toString(), $limitLink);
            }
            catch (Exception $e)
            {
                $string = preg_replace(array_keys($linkCache), $linkCache, $string, $limitLink);
            }
        }
Replace with
Code:
if (!empty($linkCache))
  {
   $limitLink = XenForo_Application::get('options')->BRAL_limitLinkPost;
   try
   {
    if ($string instanceof XenForo_BbCode_TextWrapper)
    {
     $string = $string->__toString();
    }
   }
   catch (Exception $e){}
   $string = preg_replace(array_keys($linkCache), $linkCache, $string, $limitLink);
  }
And check again.

I would love to see this extended to include features such as http://www.jv-extensions.com/products/jv-contentlinks for Joomla.

The ability to monetise content by post number, allowing people to buy keyword phrases in a specific post only, priceless. And all automatic via the defined XF payment system being used.

Possibly the ability to approve / reject with refund, just as a moderation protection.
Thanks for your suggestion and i'd like to offer you a custom work service to sort your request out.

Regards,
 

NZWarriors

New member
I think it would actually become their highest grossing add-on, to be honest, especially if sold at a reasonable entry price.
Feel free to get it custom made by them then and then sell it off. As a customer of this specific add-on, all those features would be bloat for me.
 

audiokid

Active member
What Anthony says is exactly how I see it. In fact, I have a feeling we could sit down and enjoy a pretty good conversation about this right now. We seem to be going in the exact same direction.

I use autolinks in combination with the XenCentral Adserver . The two together are the bomb.

Grouping manufacturers, implementing some way to show the stats, and being able to monetize this would put it above all others.
If XenCentral implemented this, it would be the benchmark of advertising solutions.

FWIW, banners add a visual candy to my site but give me little return in comparison to what text ads produce. And I'm not talking pennies here.
The first person who gets this text linking thing right, will have my full attention. Lets hope we get this topic steaming with energy!

Man I love xenForo.
 
Last edited:
Status
Not open for further replies.
Top