Jump to content

Advanced Custom Widgets [ Support topic ]


TAMAN

Recommended Posts

Posted

Actually I try use below embed in my site, any way to make it responsive?

<iframe src="https://play.chessbase.com" style="width:760px;height:480px"></iframe>

Posted
Just now, kmk said:

Actually I try use below embed in my site, any way to make it responsive?

<iframe src="https://play.chessbase.com" style="width:760px;height:480px"></iframe>

<iframe src="https://play.chessbase.com" width="100%" height="480px"></iframe>

 

 

Posted

Hello @TAMAN

Is possible add setting that let's widget appearing in specific club(or page or forum)? Right now I am using the widget that contained chess tutorial for the chess club, but the widget appearing in all clubs.......

Posted
Just now, kmk said:

Hello @TAMAN

Is possible add setting that let's widget appearing in specific club(or page or forum)? Right now I am using the widget that contained chess tutorial for the chess club, but the widget appearing in all clubs.......

Sorry, This is not editable.

 

Posted
10 hours ago, Josiah Wallingford said:

How do I add blocks to my custom widget?

If this is not possible, could it be added? I could really see some use for this if I could do that! No more blocks taking up precious realestate.

Possible yes,

maybe in next version. 

 

  • 2 months later...
Posted (edited)

Just be to be clear is this kind of like the old Custom Sidebar Blocks mod where it uses the header block and you can place html code in it and it displays? But it is a widget and can be place wherever a widget can? I just got moved to IPS Version 4 suite from an old 3.4 IP Board so I am learning again around here. I need to get my old IP Content blocks fixed and added back into the PAGES field so I can use them again. Many were just html code

 

 

Edited by RLPVT
Posted
Just now, RLPVT said:

Just be to be clear is this kind of like the old Custom Sidebar Blocks mod where it uses the header block and you can place html code in it and it displays?

Yes. except it has nothing to do with ips sidebar widgets.

the blocks you create are for footer only you can't use it for sidebars or anywhere else 

  • 3 months later...
Posted

Hi,

We have a slight problem and wonder if you can suggest a workaround.

We saw someone post the same issue and resolved it on their wordpress site by adding custom code or css

We are using adsense matched content and have a spot on the homepage

We are using this widget to display it and no matter what we have tried, we cannot get the matched content to use the full width of the widget.

Do you have any idea what we can do to enable the matched content to be displayed full width in the widget?

 

matched-content-not-full-width.thumb.jpg.018f463d59c18ca06aa9bddb277b6e0c.jpg

Posted (edited)
1 hour ago, Unlucky said:

Hi,

We have a slight problem and wonder if you can suggest a workaround.

We saw someone post the same issue and resolved it on their wordpress site by adding custom code or css

We are using adsense matched content and have a spot on the homepage

We are using this widget to display it and no matter what we have tried, we cannot get the matched content to use the full width of the widget.

Do you have any idea what we can do to enable the matched content to be displayed full width in the widget?

 

matched-content-not-full-width.thumb.jpg.018f463d59c18ca06aa9bddb277b6e0c.jpg

Hi,

Without a link i cant even suggest anything 

So, if you paste a link and explain the issue, im sure there are some workarounds 😉 

 

Thanks for the review. 🙂 

Edited by TAMAN
Posted
1 hour ago, Unlucky said:

I just added that to custom.css but it's still in the middle

 

Oh the title text!

.fw_Content .ipsWidget_title {text-align: left}

 

  • 1 month later...
Posted (edited)

I now get the following error when the plugin is enabled on page created with Pages:

 

System: ".$s; unset($_GET['ab_debug']); } else { $debug = false; } //Create cache folder if it does not exist $cacheFolder = abGetCacheFolder($abCacheFolderName, $debug); if ($cacheFolder) { //Current URL $page = abGetPageUrl($debug); if (strlen($page) > 0 && abIsValidUrl($page, $debug)) { $cacheFileName = $cacheFolder."/".abGetCacheFileName($page, $debug); $cacheContent = abGetCache($cacheFileName, $abCacheHours, $abCacheFolderName, $debug); if ($cacheContent === false) { //Get links from automatic backlinks $freshContent = abGetLinks($page, $abAccountCode, $v, $s, $debug); if ($freshContent !== false) { if (abSaveCache($freshContent, $cacheFileName, $debug)) { $cacheContent = abGetCache($cacheFileName, $abCacheHours, $abCacheFolderName, $debug); if ($cacheContent !== false) { echo $cacheContent; } else { $abMsg[] = 'Error: unable to read from the cache'; } } else { $abMsg[] = 'Error: unable to save our links to cache. Please make sure that the folder '.$abCacheFolderName.' located in the folder '.$_SERVER['DOCUMENT_ROOT'].' and is writable'; } } else { $abMsg[] = 'Error: unable to get links from server. Please make sure that your site supports either file_get_contents() or the cURL library.'; } } else { //Display the cached content echo $cacheContent; } } else { $abMsg[] = 'Error: your site reports that it is located on the following URL: '.$page.' - This is not a valid URL and we can not display links on this page. This is probably due to an incorrect setting of the $_SERVER variable.'; } } else { $abMsg[] = 'Error: Unable to create or read from your link cache folder. Please try to create a folder by the name "'.$abCacheFolderName.'" directly in the root and of your site and make it writable'; } foreach ($abMsg as $error) { echo $error."
"; } /** * Helper functions */ function abSaveCache($content, $file, $debug=false) { //Prepend a timestamp to the content $content = time()."|".$content; echo ($debug) ? "

Saving Cache: ".$content : ""; $fh = fopen($file, 'w'); if ($fh !== false) { if (!fwrite($fh, $content)) { echo ($debug) ? "

Error Saving Cache!" : ""; return false; } } else { echo ($debug) ? "

Error opening cache file for writing!" : ""; return false; } if (!fclose($fh)) { echo ($debug) ? "

Error closing file handle!" : ""; return false; } if (!file_exists($file)) { echo ($debug) ? "

Error could not create cache file!" : ""; return false; } else { echo ($debug) ? "

Cache file created successfully" : ""; return true; } } //Deletes any cache file that is from before Today (Max 500) function abClearOldCache($cacheFolderName, $cacheHours, $debug=false) { $today = date('Ymd'); $cacheFolder = abGetCacheFolder($cacheFolderName); if (is_dir($cacheFolder)) { $allCacheFiles = glob($cacheFolder.'/*.cache'); $todaysCacheFiles = glob($cacheFolder.'/'.$today.'*.cache'); $expiredCacheFiles = array_diff($allCacheFiles, $todaysCacheFiles); $i = 0; foreach ($expiredCacheFiles as $expiredCacheFile) { echo ($debug) ? "

Deleting expired cache file: ".$expiredCacheFile : ""; abRemoveCacheFile($expiredCacheFile, $debug); // Limit to max 500 $i++; if ($i >= 500) { break; } } } } //Returns the full path to the cache folder and also creates it if it does not work function abGetCacheFolder($cacheFolderName, $debug=false) { if (isset($_SERVER['DOCUMENT_ROOT'])) { $docRoot = rtrim($_SERVER['DOCUMENT_ROOT'],"/"); //Remove any trailing slashes } else if (isset($_SERVER['PATH_TRANSLATED'])) { $docRoot = rtrim(substr($_SERVER['PATH_TRANSLATED'], 0, 0 - strlen($_SERVER['PHP_SELF'])), '\\'); $docRoot = str_replace('\\\\', '/', $docRoot); } else { echo ($debug) ? "

Error: Could not construct cache path" : ""; } $cacheFolder = $docRoot."/".$cacheFolderName; echo ($debug) ? "

Cache folder is: ".$cacheFolder : ""; if (!file_exists($cacheFolder)) { echo ($debug) ? "

Cache folder does not exist: ".$cacheFolder : ""; if (!@mkdir($cacheFolder,0777)) { echo ($debug) ? "

Error - could not create cache folder: ".$cacheFolder : ""; return false; } else { echo ($debug) ? "

Successfully created cache folder" : ""; //Also make an empty default html file $blankFile = $cacheFolder."/index.html"; if (!file_exists($blankFile)) { $newFile = @fopen($blankFile,"w"); @fclose($newFile); } } } return $cacheFolder; } //Url validation function abIsValidUrl($url, $debug=false) { $urlBits = @parse_url($url); if ($urlBits['scheme'] != "http" && $urlBits['scheme'] != "https") { echo ($debug) ? "

Error! URL does not start with http: ".$url : ""; return false; } else if (strlen($urlBits['host']) < 4 || strpos($urlBits['host'], ".") === false) { echo ($debug) ? "

Error! URL is incorrect: ".$url : ""; return false; } return true; } //Get the name of the cache file name function abGetCacheFileName($url, $debug=false) { $cacheFileName = date('Ymd').md5($url).".cache"; echo ($debug) ? "

Cache file name for URL: ".$url." is ".$cacheFileName : ""; return $cacheFileName; } //Attempts to load the cache file function abGetCache($cacheFile, $cacheHours, $cacheFolderName, $debug=false) { //If the url is called with ab_cc=1 then discard the cache file if (isset($_GET['ab_cc']) && $_GET['ab_cc'] == "1") { echo ($debug) ? "

Clear cache invoked!" : ""; abRemoveCacheFile($cacheFile); unset($_GET['ab_cc']); return false; } if (!file_exists($cacheFile)) { echo ($debug) ? "

Error! Cache file does not exist! ".$cacheFile : ""; return false; } $cache_contents = @file_get_contents($cacheFile); if ($cache_contents === false) { echo ($debug) ? "

Error: Cache file is completely empty!" : ""; return false; } else { echo ($debug) ? "

Cache file contents: ".$cache_contents : ""; //Separate the time out $arrCache = explode("|", $cache_contents); $cacheTime = $arrCache[0]; $timeCutOff = time()-(60*60*$cacheHours); //Measure if the cache is too old if ($cacheTime > $timeCutOff) { //Return the cache but with the timestamp removed return str_replace($cacheTime."|", "", $cache_contents); } else { //echo "cacheTime ($cacheTime) <= timeCutOff ($timeCutOff)"; abRemoveCacheFile($cacheFile, $debug); abClearOldCache($cacheFolderName, $cacheHours, $debug); //Also remove other old cache files return false; } } } //Delete a cache file function abRemoveCacheFile($cacheFile, $debug=false) { if (!@unlink($cacheFile)) { echo ($debug) ? "

Error: Could not remove cache file: ".$cacheFile : ""; return false; } else { echo ($debug) ? "

Successfully removed the cache file: ".$cacheFile : ""; return true; } } //Loads links from the automaticbacklinks web site function abGetLinks($page, $accountCode, $v, $s, $debug=false) { //Make the URL $url = "http://links.automaticbacklinks.com/links.php"; $url = $url."?a=".$accountCode; $url = $url."&v=".$v; $url = $url."&s=".$s; $url = $url."&page=".urlencode($page); echo ($debug) ? "

Making call to AB: ".$url : ""; ini_set('default_socket_timeout', 10); if (intval(get_cfg_var('allow_url_fopen')) && function_exists('file_get_contents')) { echo ($debug) ? "

Using file_get_contents()" : ""; $links = @file_get_contents($url); } else if (intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) { echo ($debug) ? "

Using file()" : ""; if ($content = @file($url)) { $links = @join('', $content); } } else if (function_exists('curl_init')) { echo ($debug) ? "

Using cURL()" : ""; $ch = curl_init ($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $links = curl_exec($ch); curl_close ($ch); } else { echo ($debug) ? "

Error: no method available to fetch links!" : ""; return false; } return $links; } //remove ab_cc etc. from the current page to not interfere with the actual URL function abTrimAbVars($url) { $url = str_replace("?ab_cc=1", "", $url); $url = str_replace("&ab_cc=1", "", $url); $url = str_replace("?ab_debug=ebb384a447fd60080ea871916bf0e13d", "", $url); $url = str_replace("&ab_debug=ebb384a447fd60080ea871916bf0e13d", "", $url); $url = str_replace("&phpinfo=1", "", $url); return $url; } //Get page function abGetPageUrl($debug=false) { $query = ""; $protocol = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != "off") ? "https://" : "http://"; $host = $_SERVER['HTTP_HOST']; $page = null; if (isset($_SERVER["REDIRECT_URL"]) && !empty($_SERVER["REDIRECT_URL"])) { //Redirect if (isset($_SERVER['REDIRECT_SCRIPT_URI'])) { //Use URI - it is complete $page = $_SERVER['REDIRECT_SCRIPT_URI']; } else { //Use file and query $file = $_SERVER["REDIRECT_URL"]; if (isset($_SERVER['REDIRECT_QUERY_STRING'])) { $query = "?".$_SERVER['REDIRECT_QUERY_STRING']; } } } else { //No redirect if (isset($_SERVER['REQUEST_URI'])) { //Use URI if (substr($_SERVER['REQUEST_URI'],0,4) == "http") { //Request URI has host in it $page = $_SERVER['REQUEST_URI']; } else { //Request uri lacks host $page = $protocol.$host.$_SERVER['REQUEST_URI']; } } else if (isset($_SERVER['SCRIPT_URI'])) { //Use URI - it is complete $page = $_SERVER['SCRIPT_URI']; } else { $file = $_SERVER['SCRIPT_NAME']; if (isset($_SERVER['QUERY_STRING'])) { $query = "?".$_SERVER['QUERY_STRING']; } } } if (empty($page)) { $page = $protocol.$host.$file.$query; } $page = abTrimAbVars($page); echo ($debug) ? "

This page is reported as: ".$page : ""; return $page; } //Show phpinfo if debug is on and phpinfo is requested if ($debug && !empty($_GET['phpinfo']) && $_GET['phpinfo']) { ?>

Edited by Christforums
Posted

Does the widget support Javascript in when it's in processing HTML?

Also, not sure if it's possible but a "forums select" option in the widgets edit menu that lets you choose which forums the widget is visible on, would be fantastic.
Issue being that if you add it on the a specific topics page, it will be visible in every topic.  Or if you add it to a forum in the topics list section, it will be visible in all forums topics list sections.  The ability to select where specifically, on what forums these widgets appear could be nice. 

Posted (edited)
4 hours ago, Christforums said:

I now get the following error when the plugin is enabled on page created with Pages:

Does not happen here, the errors has anything related to this plugin. 

if you have created custom blocks then please delete it or check your codes in the custom block. 

 

3 hours ago, RobotMonkeyHæd said:

Does the widget support Javascript in when it's in processing HTML?

Also, not sure if it's possible but a "forums select" option in the widgets edit menu that lets you choose which forums the widget is visible on, would be fantastic.
Issue being that if you add it on the a specific topics page, it will be visible in every topic.  Or if you add it to a forum in the topics list section, it will be visible in all forums topics list sections.  The ability to select where specifically, on what forums these widgets appear could be nice. 

Hello,

Yes you can paste javascript in the custom blocks. 🙂

 

This plugin uses the default ips widget features you cant have widgets in specific topics or topics list i believe 

Edited by TAMAN
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...