
FocuSoft
New Members-
Posts
6 -
Joined
-
Last visited
Everything posted by FocuSoft
-
I have two situations on Facebook Object Debugger, one for http and one for https (Please see attached images). This one is if I input the http link and this one for https link The code of my joomla extension is: <?php /*------------------------------------------------------------------------ # mod_ofblikebutton - Optimized Facebook Like Button # ------------------------------------------------------------------------ # author: Optimized Sense # copyright: Copyright (C) 2013 http://www.o-sense.com. All Rights Reserved. # @license: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # Websites: http://www.o-sense.com # Technical Support: http://www.o-sense.com/contact-us/support-inquiries.html -------------------------------------------------------------------------*/ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); class oFBLikeButton{ function getData(&$params ){ $oFBLinkTitle = 'O-Sense'; $oFBLink = 'http://www.o-sense.com'; //$oFBLinkImg = 'http://www.o-sense.com/osensecopy.png'; //$oFlink = $params->get('olink');/// $oFBLink = JURI::current(); $oFshowSend = $params->get('oshowSend');/// $oFstyle = $params->get('ostyle'); $oFwidth = $params->get('owidth', '400');/// $oFfaces = $params->get('ofaces');/// $oFfont = $params->get('ofont');/// $oFcolor = $params->get('ocolor');/// $oFverb = $params->get('overb');/// $oFsource = $params->get('osource');/// $oFlang = $params->get('olang');/// if($oFfaces == '1'){ $oFfaces = 'true'; }else{ $oFfaces = 'false'; } if($oFshowSend == '1'){ $oFshowSend = 'true'; }else{ $oFshowSend = 'false'; } $data =''; if($oFsource == '1'){ //HTML5 $app = JFactory::getApplication(); $menu = $app->getMenu(); $lang = JFactory::getLanguage(); $fburl = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; if($fburl == 'https://www.atlantotec.com/de/' || $fburl == 'https://www.atlantotec.com' || $fburl == 'https://www.atlantotec.com/de') { $pageurl = 'http://www.atlantotec.com/de/'; $spageurl = 'https://www.atlantotec.com/de/'; } else { $finalurls = explode('/',$_SERVER['REQUEST_URI']); $urls = ''; foreach ($finalurls as $finalurl){ if($finalurl != ''){ $urls .= '/'.$finalurl; } } if ($lang->getTag() == 'it-IT') { $pageurl = 'http://'.$_SERVER['HTTP_HOST'].$urls; $spageurl = 'https://'.$_SERVER['HTTP_HOST'].$urls; } else { $pageurl = 'http://'.$_SERVER['HTTP_HOST'].$urls; $spageurl = 'https://'.$_SERVER['HTTP_HOST'].$urls; } } $data = '<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=541263185976160"; fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\'));</script>'; $data = $data . '<div class="fb-like" data-href="'.$pageurl.'" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>'; /*$url = 'http://api.facebook.com/restserver.php?method=links.getStats&urls='.$pageurl.','.$spageurl; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $retrun = curl_exec($ch); curl_close($ch); $oXML = new SimpleXMLElement($retrun); $total_count=0; foreach($oXML->link_stat as $link_stat){ //if($total_count != $link_stat->total_count || $total_count ==0) $total_count += $link_stat->total_count; }*/ /*$data = '<div class="fb-like" data-href="'.$spageurl.'" data-layout="button" data-action="like" data-show-faces="false" data-share="true"></div>'; $data = '<div id="fb-root"></div><script language="javascript" type="text/javascript">(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/'.$oFlang.'/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs);}(document, \'script\', \'facebook-jssdk\'));</script>'; $data = $data.'<script language="javascript" type="text/javascript">//<![CDATA[ document.write(\'<div class="fb-like" data-href="'.$pageurl.'" data-width="'.$oFwidth.'" data-colorscheme="'.$oFcolor.'" data-show-faces="'.$oFfaces.'" data-send="'.$oFshowSend.'" data-font="'.$oFfont.'" data-action="'.$oFverb.'" data-layout="button"></div><div class="pluginCountButton pluginCountNum"><div class="pluginCountButtonNub"><s></s><i></i></div><span id="fb-count">'.$total_count.'</span></div> \'); //]]> </script> <div style="display:none; position: relative; height: 15px; width: 100%; font-size: 10px; color: #808080; font-weight: normal; font-family: \'lucida grande\',tahoma,verdana,arial,sans-serif; line-height: 1.28; text-align: right; direction: ltr;"><a href="'.$pageurl.'" target="_blank" style="color: #808080;"> <img alt="OSense" src="'.$oFBLinkImg.'" style="visibility:visible; zoom: 1; opacity: 1; vertical-align: text-top;" /> '.$oFBLinkTitle.'</a></div>';*/ /*$data = $data.'<script language="javascript" type="text/javascript">//<![CDATA[ document.write(\'<div class="fb-like" data-href="'.$spageurl.'" data-width="'.$oFwidth.'" data-colorscheme="'.$oFcolor.'" data-show-faces="'.$oFfaces.'" data-send="'.$oFshowSend.'" data-font="'.$oFfont.'" data-action="'.$oFverb.'" data-layout="'.$oFstyle.'"></div> \'); //]]> </script> <div style="display:none; position: relative; height: 15px; width: 100%; font-size: 10px; color: #808080; font-weight: normal; font-family: \'lucida grande\',tahoma,verdana,arial,sans-serif; line-height: 1.28; text-align: right; direction: ltr;"><a href="'.$spageurl.'" target="_blank" style="color: #808080;"> <img alt="OSense" src="'.$oFBLinkImg.'" style="visibility:visible; zoom: 1; opacity: 1; vertical-align: text-top;" /> '.$oFBLinkTitle.'</a></div>';*/ }else if($oFsource == '2'){ //XFBML $data = '<div id="fb-root"></div><script language="javascript" type="text/javascript">(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/'.$oFlang.'/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs);}(document, \'script\', \'facebook-jssdk\'));</script>'; $data = $data.'<script language="javascript" type="text/javascript">//<![CDATA[ document.write(\'<fb:like href="'.$oFlink.'" width="'.$oFwidth.'" colorscheme="'.$oFcolor.'" show_faces="'.$oFfaces.'" font="'.$oFfont.'" send="'.$oFshowSend.'" layout="'.$oFstyle.'" action="'.$oFverb.'"></fb:like> \'); //]]> </script> <div style="display:none; position: relative; height: 15px; width: 100%; font-size: 10px; color: #808080; font-weight: normal; font-family: \'lucida grande\',tahoma,verdana,arial,sans-serif; line-height: 1.28; text-align: right; direction: ltr;"><a href="'.$oFBLink.'" target="_blank" style="color: #808080;"> <img alt="OSense" src="'.$oFBLinkImg.'" style="visibility:visible; zoom: 1; opacity: 1; vertical-align: text-top;" /> '.$oFBLinkTitle.'</a></div>'; }else { //iFrame $oFsource ="http://www.facebook.com/plugins/like.php?locale=".$oFlang."&href=".$oFlink."&width=".$oFwidth . "&colorscheme=".$oFcolor."&show_faces=".$oFfaces . "&send=".$oFshowSend."&layout=".$oFstyle."&font=".$oFfont."&action=".$oFverb."&height=26"; $data = '<iframe src="'.$oFsource.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$oFwidth.'px; height:26px;" allowTransparency="true"></iframe> <div style="display:none; position: relative; height: 15px; width: 100%; font-size: 10px; color: #808080; font-weight: normal; font-family: \'lucida grande\',tahoma,verdana,arial,sans-serif; line-height: 1.28; text-align: right; direction: ltr;"><a href="'.$oFBLink.'" target="_blank" style="color: #808080;"> <img alt="OSense" src="'.$oFBLinkImg.'" style="visibility:visible; zoom: 1; opacity: 1; vertical-align: text-top;" /> '.$oFBLinkTitle.'</a></div>'; } return $data; } } What I want to do is to share http link and to show the shares from http link, in this moment I can share the http link, but I see the https shares. In Facebook Object Debugger you can see if I check the http link I see the https shares, if I check the https link I see the http shares. So how to share http and see http shares not https?
-
Redirect or error if the code doesn't exist in code.txt
FocuSoft replied to FocuSoft's topic in PHP Coding Help
Can you give me an example please ?- 9 replies
-
- php
- javascript
-
(and 3 more)
Tagged with:
-
Redirect or error if the code doesn't exist in code.txt
FocuSoft replied to FocuSoft's topic in PHP Coding Help
I don't need to use 1 - Open code.txt (fopen()). and 2- Write the promotional code (fwrite()). I will write manually the codes here. I just need to 1 - Open code.txt (fopen()) 2 - Check if the code exist in code.txt 3 - Close code.txt (fclose()) 4 - If exist redirect to download.php 5 - If not exist redirect to promotieerror.php- 9 replies
-
- php
- javascript
-
(and 3 more)
Tagged with:
-
Redirect or error if the code doesn't exist in code.txt
FocuSoft replied to FocuSoft's topic in PHP Coding Help
Thanks for the answer but not this was my needs. In this form my users input a promotional code that I send to them by email. I don't use databases. Remember that. Now I put writed by hand in a code.txt file all promotional codes that I want to send. When a user come to my webpage form they will input the code received, but if they input a wrong code that doesn't exist in code.txt they will not be redirected to download.php page, they will be redirected to promotieerror.php . That I need, is that possible? Thanks for helping.- 9 replies
-
- php
- javascript
-
(and 3 more)
Tagged with:
-
I have in promotie.php the next form: <form accept-charset="UTF-8" action="redirect.php"> <input name="code" type="text" id="code" maxlength="15" /> <input type="submit" value="Submit"/> </form> In redirect.php I have this code: <?php header('Location: download.php?code='.$_POST['code']); ?>What I want to do is the next thing: I will create a file code.txt, where I write on each line my promotional codes. Now how can I redirect to promotieerror.php or show a error if the code that was writed by the user doesn't exist in code.txt ? P.S.: I don't want to use MySQL/Databases. Thanks in advance for help.
- 9 replies
-
- php
- javascript
-
(and 3 more)
Tagged with:
-
Hello, I have this code: <?php $dateTime = date('Y/m/d G:i:s'); $fp = fopen('log.txt', 'r+'); if(!$fp){ echo "Log file doesn't exists."; } else{ $visited = FALSE; while (!feof($fp)) { $buffer = fgets($fp); list ($ip, $time) = split(' ', $buffer); //Checks if IP is already logged. if ($_SERVER['REMOTE_ADDR'] == trim($ip)){ $visited = TRUE; echo "Not your first visit."; } } if (!$visited){ fwrite($fp, $_SERVER['REMOTE_ADDR']. " $dateTime\n"); echo "First visit."; } fclose($fp); } ?> This log ip of visitors, and if is first visit will show us "First visit.", if is not the first visit will show us "Not your first visit." Now I want to do some modifications to this code, I want to redirect visitors if is not the first visit, and if is the first visit to show a newsletter.html page I think is simple, but I'm not a PHP coder and I don't know how to do it. Thanks in advance for help.