Wordpress: Converte specific Links in Backend-Editor with Link Tool - php

I am looking for a way to loop the links to be inserted beforehand and generate to a specific link. The links are recognized and converted based on their domain, I have already managed that. Unfortunately, I don't know how to insert a small button there and then send the selected link through the loop accordingly.
I don't know what is easier to implement:
1 possibility:
Link is converted directly when inserted
enter image description here
2nd possibility
Links are inserted and then you click on them and you have a small field with the converter.
enter image description here
I thank you!

Related

How To make Some Text In a whatsapp message as link

I want to make a particular text as link in whatsapp text so that it can be copied rather then coping full message i just want that particular text to get copied as in the screenshot : https://prnt.sc/taago5 you can see that its blue in color that means its like a link when long pressed it gets copied.
similarly i want the text in red box as link so that it can be copied : https://prnt.sc/taahd4
You simply can not make just any arbitrary text you want, become a link. There is no mechanism or syntax provided to achieve this.
WhatsApp parses the message content, and replaces parts that match certain patterns with links automatically - for example HTTP/HTTPS URLs.
What your first screenshot shows, 544-497-293, gets recognized as a (potential) phone number here, and that is why it gets transformed into a link automatically.
But you won’t be able to force this in any way, for the arbitrary format you have in your second screenshot.

Drupal 7: How can I link uploaded images (via an image field) to specific URLs contained in a text field?

I need to link individually uploaded images (via an image field) to different external URLs (e.g. Link one image in one post to a website outside of my own). I've found modules that allow me to link image fields to nodes within my drupal site, but nothing that allows me to link uploaded images individually to different urls. That said, I figured I could create a text field, input a URL there, and set my Image Field in views to be linked to the contents of that field. E.g. Destination: [field_link_image_to]
However that doesn't seem to be do-able either. Any suggestions as to how I can go about doing this?
Use Link field module (https://www.drupal.org/project/link). After enabling add this field to the same content which contains the image you want to link to specific URLs.
Create a view then include both image field and link field url (you will get the exact URL which you will enter into the link field) then add custom text and create your html accordingly.
Let me know if it works or you want something else.
Thanks.

How to send an image from one page to another page using PHP

I have a project am working on,, its about (Graphical Password) it's an authentication security system (Web Based), which ask the user to register by entering his information such as (first name.. last name.. etc ) and with these information there will be a group of images with each image has a number written below it ,, so the user will enter his info like usually and will be an extra field for (image number) the user write the number of the image that he want ,,(the images will be previewed as thumbnails in the page). at the end he click submit, the information it will be stored in database using (PHPMyAdmin),in the database there will be columns for each data plus a column for image number, it will be storing the image number ONLY not the images, the images stored in a folder with its names from (1-20), till here no problem..
The Problem is : When the user click submit it should open another page and it should display the image that he chosen before from the previews page with big size image so later i can do some processing on the image..
My Question is : How to send that image to another page by using PHP language..
Am using DreamWeaver CS6, here is a photo of the site http://www.4shared.com/photo/YcBeAhsz/Capture.html?
and the code is here : http://www.4shared.com/file/unOI9Ejs/registeration_page.html?
I hope my question is clear and i wish i can get some answers.. thanks in advance..
This is a little tricky without know the code your using.
You can store the images you get to the web server by:
file_put_contents('image1.gif',file_get_contents('http://static.php.net/www.php.net/images/php.gif'));
The on the next page display the image back.
<?php
$user_picked_img_id = 1;
?>
<img src="image<?php echo $user_picked_img_id ?>.gif"/>
Let me know if that fits what you are trying to do.

Grabbing images from a Website

I wonder if anyone can point me in the right direction.
I have a rather large spreadsheet of product info that needs plugging into a shop. The tricky bit is that the spreadsheet has a link which points to the relevant page on another site which has the products details, and what i need to do is grab that relevant Image and save locally, so I can use later.The reason Why Im thinking down this line is there are 7500 products....
My friend suggested I could maybe use php & filepopen.
The image does have an outer tag ID which I can refer to.
I was thinking of iterating through the spreadsheet this is the type of link I have to work with
http://www.apc.com/resource/include/techspec_index.cfm?base_sku=APCRBC105
the images themselves are called something random, but I figured I could rename them as I grab them to the more relevant SKU number.
so iterate through the spreadsheet by SKU number
identify the image by the relevant id on the page (I'm assumming it's
in the same place on every page)
save the image while renaming to the correct SKU number
Any ideas on how I could go about this ? the thought of visiting each page manually and saving the image 7500 times doesn't seem the best way forward!
Thanks for looking
Rip the base_sku from your links.
APCRBC105
Then use curl to fetch the image page
http://www.apc.com/products/moreimages.cfm?partnum=APCRBC105
Rip the image link with a regex epression on :
<div align="center">
<img align="center" src="http://www.apcmedia.com/resource/images/500/Front_Left/35531838-5056-9170-D33F24AE47742E6C_pr.jpg" />
</div>
Then use curl again to rip the actual image and save it.
That should work..
If there aren't any issues regarding copyrighted material, take a look at Google Refine.
You can grab content from websites based on your cell values and use them afterwards to build more complex scenarios.
See the screencasts for more info (screencast 3 talks about fetching values via URLs).
Once you have the Image URL's in your spreadsheet, it should be fairly easy to fetch them via curl or similar.

how to add photos to PHP blog postings using admin page

I managed to create a simple blog and an admin page using PHP. I didn't use a CMS like wordpress because I wanted a deeper understanding of PHP.
I wanted to create an admin page that allowed the user to specify where in their blog posting they could put in a picture; for example, they can add a photo before the first paragraph or after.
My admin page as it is now is just a textarea input field and a submit button that submits text-only blog posts from the textarea field to the database. My thought process was that I could add img tags into the textarea input field, but the user's photos might be stored on their hard drive so I thought of the idea to store PHP code in the textarea input field to retrieve image files from the database. For example, if I wanted to place a photo after the first paragraph of the blog post, I would type something like this into the textarea field:
This is the first paragraph. Here is a photo of my vacation:
<? echo "<img src='getPhoto.php?page=blogPost'>"; ?>
Then I click the "submit button" and the paragraph with the PHP code gets submitted into my database. The page with the blog posting retrieves the text, "This is the first paragraph. Here is a photo of my vacation:" and the PHP code. The PHP code then retrieves and shows the photo.
The problem is that submitting PHP code with the blog text might be confusing for a user who is not tech-savvy or does not have any programming knowledge. The admin page should make it possible for the blog writer to place photos anywhere in their blog post without programming knowledge. I haven't found a tutorial yet that covers image placement in a PHP blog's admin page. Any help getting started would be appreciated.
One way to accomplish what you want is by implementing custom shortcodes. In you case it'd look something like this:
This is the first paragraph. Here is a photo of my vacation:
[image bahamas-00123]
How it works is that you do something like this:
$text = shortcodes($text);
You'd need a separate area for uploading photos and some way of keeping track of them (ie: sql, flatfiles) so you know that bahamas-00123 actually refers to /some/path/DSC-00123.JPG.
For some code please check the accepted answer of: How do I replace custom “tags” in a string?
You can use a text editor like ckeditor or tinymce to format the text and upload images. This way users need not be aware about the custom tags and they can place the image wherever they like.

Categories