I need help. I installed the Wiris math editor, but it does not work. Creating math works well, but the display does not work.
I know why, but I do not know how I repair it: I use free hosting which paste advertisement into the website's URL.
I want the URL to look like:
http://u12.hys.cz/tinymce/js/tinymce/plugins/tiny_mce_wiris/integration/showimage.php?formula=3b1e36f0f64404ca46029248411a14da&cw=20&ch=13&cb=12&text=55
while my provider changes it to:
http://u12.hys.cz/%3Cdiv%20style=%22%20background-color:#; font-size: px;"><div class="trop"><strong>Magnetická </strong>kostka NeoCube na prodej</div></div>/tinymce/js/tinymce/plugins/tiny_mce_wiris/integration/showimage.php?formula=3b1e36f0f64404ca46029248411a14da&cw=20&ch=13&cb=12&text=55
Note that the provider added the following part
%3Cdiv%20style=%22%20background-color:#; font-size: px;"><div class="trop"><strong>Magnetická </strong>kostkaNeoCube na prodej</div></div>
Is there anything I can do?
This issue is not related to WIRIS plugin but to an advertisment your server provider is including in the image URL generated by our plugin. We are not sure when does your server provider modify the image link but we output the image link in //integration/createimage.php where you could probably remove the advertisment.
Related
I would like to embed an iphone/smartphone simulator in my website. I found this one:
https://github.com/rioleo/web-iphone-simulator
After adding the files to my directories, and trying to embed it:
<div align="center"><iframe src="http://localhost:8080/iphone?url=mysite" width="540" height="900" frameborder="0"></iframe></div>
A blank frame shows up with the message "The server refused the connection".
What causes the problem, and does anyone know other free simulators that can be embedded in websites?
Maybe dynamically modifying the navigator.userAgent string using JS? Take a look here.
Have you tried with iphone.php?url=mysite instead iphone?url=mysite??
I'm using Wordpress to create a blog and I noticed that when I save a post multiple times, a weird element appears in the code, creating a big white space in the bottom of the post.
The code looks like this:
...post content
<object id="ba7ab859-2a8a-9fa1-988a-4a9938aba59b" width="0" height="0" type="application/gas-events-abn"></object>
Every time I edit a post I have to remove it. With Joomla sometimes used to happen the same thing. What can I do to solve this?
This tag is added by protection bank plugin developed by Gas Tecnologia, a brazilian company, expert in internet security. This company provides service to the banks: Banco do Brasil, Caixa Econômica Federal, Itaú, Santander, Banco Mercantil do Brasil, Banco da Amazônia, Banestes, Tecnocred/Unicred.
I contacted the company to find out why the "tag object", but so far not replied.
If you wish this is the link to site of company: http://www.gastecnologia.com.br
As said by Vinicius Monteiro, this is a serious bug from the crazy devs on Gas Tecnologia. The hack-ish way we're using to solve this is adding this piece of CSS to your pages:
object[type^=application/gas-events] { display: none; }
I did some adjust to hide all elements with contains the word application/gas-events:
object[type*='application/gas-events'] { display: none; }
Your site (or browser) has been hacked. You can find the same string with varying id in some forums:
social.msdn.microsoft.com
social.technet.microsoft.com
answers.atlassian.com
forum.dancehallreggae.com
many more.
Other findings
Most of the affected sites are Brasilian.
According to this tweet, the tag is generated by a Santander protection module.
Same thing with "GBBD Caixa Economica Federal" extension (Chrome), putting this "application/gas-events-abn" everywhere. Seems to be a common problem with intern banking extensions.
And to get worst it's impossible to deactivate while not using internet banking (at least in Chrome), the only solution is remove the extension or clean the post content field AND the excerpt field if it have tinymce activated.
body + object, body + object + object { display: none; }
I placed that on my Stilysh Chrome Extension and solved the problem just fine since they put the objects always in the footer (in my case there where 2 of them, CEF (caixa economica federal) and BB (banco do brasil) if you have more banks, just add more objects ;)
In my case, the class object had height 100%. I just commented the code.
object, embed{
/* height:100& */ I commented this height, because it leaves a space under the footer;
}
I've been looking all over the place but can't seem to find an issue quite like mine. Maybe I haven't been putting together the right keywords; but perhaps I'll have more luck just explaining my issue.
I've put together the following little code:
$image_types = array('gif','png','jpg');
$recent = array();
foreach($image_types as $image_type) {
foreach(glob('first/second/*.'.$image_type) as $filename){
$recent[$filename] = time() - filemtime($filename);
}
}
$recent = array_keys($recent, min($recent));
$recent_img = $recent[0];
What it's supposed to do is look into a specific folder and find the latest image and, later, place it into the webpage. What it does do is find the latest image, path and all. So everything is working up to there. If I echo $recent_img I get the latest image's src, so obviously I'd want to place the following code right after: <img src="<?php echo $recent_img ?>" /> and I should get the image. Surely enough, everything works fine, even up to the point locating within the HTML an <img> that refers to the image I need. HOWEVER, there's something going haywire at this point!
If glob() is set to the path first alone, the code works entirely: the image is shown in the website. But with the second folder added, it does everything except show the image on the website.
So I go to the result website and check the source code and the image code is as follows:
<img src="first/second/img.jpg" style="display: none !important; visibility: hidden !important; opacity: 0 !important; background-position: 0px 0px;" width="0" height="0">
Notice the display:none!important the visibility:hidden!important etc., almost like the CSS is set to do everything it can to avoid showing the image. Including setting the width and height to 0 when the image is obviously not 0 x 0 pixs. (Just in case: nor is there any instance in my style sheet which would result in setting everything to 0 and hidden and etc. on any image in my project.)
However, as I said, this does not happen when the path only has the one part, the folder first. I've tried putting all the images from one folder into the other and still the issue remains. I've edited the CSS values on the spot in Chrome and still nothing.
It seems like an absurd issue to have because nothing is changing except the code is looking for a file inside of a folder that is inside a parent folder. Moreover because the code actually works to the point of showing the file I need and its path but not the file itself.
Online trial example for you guys to see and TEMP solution or, rather, 'workaround'.
I hate working around an issue. It usually complicates things and/or makes them messy. First of all, in this case it is an organization issue. It's much better to have ALL images in one folder and then make sub-folders for different kinds. Having many image folders floating about the root is not a good idea to me. Second, it seems absurd to have to use a 'workaround' when there seems no logic in the error. Third, I really would like to learn what is going on and not turn this into a PHP Bermuda Triangle. So please don't take my TEMP solution as me giving up, and please continue the synergy of this wonderful place, where no doubt at some point we'll arrive to a solution.
At any rate, the 'workaround' you've probably already guessed is to place the second folder in the same directory as the first folder, which is the root. So this should solve that specific issue. But it's not a genial solution if you ask me.
I've been asked to upload an online trial of the issue and I've done so >>HERE<<. You'll be able to see the same code looking for the latest image in first/second/ and in first/, and you'll see that one works marvelously where the other mysteriously flops!
QUESTION: Just occurred to me. Could it have something to do with the length of the path name? I.e. first/ is O.K. but first/second/ is too long? Doesn't make much sense taking into consideration that the retrieval of info from the path is successful, and the issue is rather on the side of the HTML outcome, but I have since tried placing the second folder in the root and gave it a 10-letter name and the issue was recreated. This, however, only happened in WAMP localhost, as when I uploaded everything online, the length didn't seem to matter. However, even online, as you can see from my LINK the first issue remains.
You can try retrieve the src and update using jquery:
$.get('image.php').success(function(src) {
$('#myimg').attr('src',src);
});
I have a need for getting preview a url over mouse hover, my application is built on php , js and jquery. Although I have an idea of to get to my requirements but am a little confused with the right approach, i checked all the posted question on here but most of them refer to some third party tools or installables. Frnakly i do not want to use them and think i should try one on my own. Please can you guide me through on the best possible step as per you?
Thanks!
11-Jun-2012
Finally I managed to use Curl and get a preview of the site on a Div placed next to the Link on my site, well now the problem is of fitting the content in the Div ..is there a way that I can adjust the css of the extracted html page in such a way that all the content fits in the fixed height and width of the Div.scaledown option or something? that would scale everything down to the required proportion?
You can do this, in plain ol' CSS and HTML:
.mouseover {
position:absolute;
width:200px;
height:200px;
top:5px;
left:5px;
display:none;
}
.link {
position:relative;
}
.link:hover .mouseover {
display:block;
}
Then, in HTML:
<a href="#" class="link">Link
<div style="background:url('<URL HERE>')" class="mouseover"></div>
</a>
Ok, so you want to get a thumbnail of a webpage and show it on mouse over. To do that, you'll need to either use tools that generate thumbnails or write a PHP script yourself. Here are some tools:
websnapr
Website Thumbnail Generator - This one you can install on your own server
If you want to write your own, check out imagegrabwindow. Note that it requires a Windows server. I don't know if PHP has any other methods to do this. If you're not on a Windows server, you could write a bash script to open a browser and use a screenshot utility to take a screenshot and save it to a file for your website to pick up.
You'll also have to make sure to have some sort of cache so you're not doing this every time every user moves their mouse over a link.
You can use urlbox.io for this, here's an example preview thumbnail of this very URL:
https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/32040df25d7c57da28ef4da7ce461af00d852653/png?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10970647%2Fthumbnail-preview-of-a-url-using-php-and-javascript&thumb_width=400
You can see that the options passed into the Urlbox API are simply url, and thumb_width to set the desired width of the thumbnail in pixels, in this case I chose 400 pixels wide.
Now all you got to do is embed it in an <img> tag like so:
<img src="https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/32040df25d7c57da28ef4da7ce461af00d852653/png?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F10970647%2Fthumbnail-preview-of-a-url-using-php-and-javascript&thumb_width=400"/>
You can use API to do this. For example ApiFlash has a free plan that you can use up to 100 screenshots per month.
Here is how it would look like with PHP:
<?php
$params = http_build_query(array(
"access_key" => "YOUR_ACCESS_KEY"
"url" => "https://example.com",
));
$image_data = file_get_contents("https://api.apiflash.com/v1/urltoimage?" . $params);
file_put_contents("screenshot_api_example.jpeg", $image_data);
?>
The API has a very good uptime because it's based on AWS Lambda.
I am having trouble using a script I found at http://www.marcofolio.net/webdesign/use_a_custom_font_on_your_website.html
The problem is, when I load a page, the text shows up then each word is replaced by a generated image of it using the PHP GD lib.
It creates a flicker effect that I can't seem to get rid of. There are options is the js file:
var hideFlicker = true;
var hideFlickerCSS = "replacement-screen.css";
var hideFlickerTimeout = 0;
But when I change any of those settings, nothing happens.
Please help!
Thank you.
For what you seem to be trying to do, image replacement is an extremely outdated method. All the ninja-devs are using technology called #font-face for their fonts and font replacements.
It's simpler, doesn't require anything to happen on the server and text on the page can be modified dynamically.
You can use services like http://www.fontsquirrel.com/ or http://code.google.com/webfonts for ready made font packages.
If you have a custom font (that you have a license for) you can create an #font-face package for it, using fontsquirrel's #font-face generator: http://www.fontsquirrel.com/fontface/generator
And then you just define your fonts in the CSS. Simple, elegant and works in 99% of browsers (yes, even IE6)
Cheers!