does facebook post api fied description support html - facebook

Will the description field support html tags
$facebook->api("/me/feed", "post", array(
message => $des,
picture => $img,
link => $link,
caption => $title ,
description =>$desc
));
I would looking to have description as
$desc="hai to <strong>All</strong><br>I am on the nextline";
Thanks in advance

No, facebook doesn't interpret formatting in the description field (simply shows as them you send it), and you can't place newlines. If you want to add extra links to the message you can use the properties field of the Post object.

Related

How to pass params in url to a backpack create form

I'm using backpack 3.3 on a laravel 5.5 installation.
I want to prefill two create form fields with two URL passed values.
Say you create a basic backpack crud, named Image.
Normally you can go to domain/admin/image/create to view and fill in the form.
But if I add one or two params in the url, I get a 404.
I guess I should manage the routes file (admin.php)
I tried this way:
Route::group(['prefix' => 'image/{k}/{cid}'], function()
{
CRUD::resource('image', 'ImageCrudController');
});
but still get a 404.
Any suggestions?
Thanks in advance.
Almost all field types have a default option. So when you define them, you can specify a default. And you can always pass a GET parameter for that default. So you can have something like this in your EntityCrudController:
$this->crud->addField[ // Text
'name' => 'title',
'label' => "Title",
'type' => 'text',
'default' => \Request::has('title')?\Request::has('title'):false, // default value
]);
You'd then be able to send you users to yourapp/admin/entity/create?title=your+default+value and have that default value show up in the field.
Hope it helps. Cheers!
it works for me easier
http://127.0.0.1:8000/admin/resultado/create?competencia=2
$this->crud->modifyField("competencia_id",[
'label' => "Competencia",
"default"=>$this->crud->request->query->get('competencia'),
.....

The validation rule is not applicated to the field when using CKEditor with Symfony2 Form

As in the title, I Don't know why when I applicate CKEditor class to my Symfony2 Field Form as follow:
->add('contentCours', null,array(
'label' => 'Content: ',
'attr' => array('class'=>'ckeditor')))
If the Form is submitted, I will got an SQL exception telling me that the colomun content_cours can't be null!
But that won't happen when I remove the CKEditor class atrri from the field...
I don't know what the wrong with that really, am I messing somthing?
THanks for your help :)
Edit: To be more clear, I want the following => Don't subbmit the form if the "contenctCours" field is blank.
You should check if your CKEditor updates textarea field and correct POST request sent on form submit. This also may help "CKeditor update on submit post"
In my case CKEditor didn't sent POST data because of wrong type of field, i had <input> field but CKEditor needs to use <textarea> to save the POST data, so i had to change the field type from null or TextType to TextareaType.
Dont forget to import the class:
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
Example:
->add('contentCours', TextareaType:class, array(
'label' => 'Content: ',
'attr' => array('class'=>'ckeditor')
))

Populate webpage textboxes using Perl script.How?

I've a webpage which has 2 text boxes. When i open the webpage cursor points to the first textbox. I need to fill these two textboxes and click on submit. I've written the code, but not working. I don't know the textboxes names as its on the server controlled by the company and no access to me. I would require something like a
fill a text box then do a tab fill anther text box do a tab and then click submit button. Any help?
#! /usr/local/bin/perl
use LWP::UserAgent;
use WWW::Mechanize;
my $agent = WWW::Mechanize->new(autocheck => [1]);
my $url = 'http://example.com/pages/editpage.action?pageId=197431143';
$agent->get($url);
$agent->submit_form(
fields => {
username => $username,
password => $password,
},
button => 'Log In'
);
Host confluence.broadcom.com is NXDOMAIN, so I am not able to verify your or my code. I think the mistake is that you picked the wrong variant of submit_form, it should look rather thus:
$agent->submit_form(
with_fields => {
username => $username,
password => $password,
},
);
The simplest approach here is to log into the page manually and then view the page source (Click Tools->View Source in Chrome for example). You should be able to identify the names of the text boxes by looking at the source.
If you scan the source (Ctrl-F) to find the prompt for the text box you should be able to easily find the associated input field. From there check the input attributes for a "name" or "id" attribute and use that for your input field.
So if you had a password text input box defined by something like:
<input name="j_password" id="passwd" ....>
your code to enter the password would look like:
j_password => $password
It's not my experience that the field names for a log in page change all that often so use the identified field names in your script and you should be good to go.
the clue is:
my $hostname='your dns host name';
my $LoginPage = 'https://$hostname/login.action';
my $cookie_jar = HTTP::Cookies->new(file => 'cookies', autosave => 1, ignore_discard => 1);
my $agent = WWW::Mechanize->new(cookie_jar => {}, autocheck => 0);
$agent->{onerror}=\&WWW::Mechanize::_warn;
$agent->get($LoginPage);
$agent->form_name('loginform'); #selest proper form
$agent->field(os_username => $user); #set user name field
$agent->field(os_password => $pass); #set password field
$agent->click("login"); #click button 'Log In'
then $agent you can use with get method:
$agent->get($someURL);
$content=$agent->content;
Finally in variable $content you have page source. It is no matter it is browser viewable page or json got by rest interface (it is url depended)
You must look into source on login page. simple put login page url into browser, then on example in firefox run tool named FireBug, or more complicated view page source. Then all names with this code example have sense :) The most component are addressed by name, not by id tag.
Some cookie is needed, because the most pages that needs login, stores authentication key as web cookie, because web communication is stateless.
Of course this example works for me with current confluence version 6.x series. Probably this should work with older confluence 5.x .

Wordpress: Post same blog entry to multiple pages

On my Wordpress site, I have the main blog entry page, then I have two sub blog pages. I would like to know if there is a way so that whenever authors submit a post to the main page, that same post is also posted in one of the sub blog pages. I would think that there is a plugin to do this sort of thing. The closest I have come to is this plugin, http://wordpress.org/plugins/duplicate-post/ but it does not seem that this one automates the process.
I may just edit that plugin to do it automatically, but I would like to at least try and see if there is one already out there. Ideally, I would like the plugin to have a selection of which page the blog should be added to on the edit page. Something like Add this post to Blog Page 1 or Blog Page 2 with check boxes by either page. Thanks in advance for any help.
You say you have 2 sub blog pages in which you want to have the option to display any posts taht are submited by authors. I'm thinking at a custom post meta that you can use to filter posts in the sub blog pages this way if the author wants to place the post in blog page 1 it will set the postmeta to blog1 if he wants it in blog page 2 it will set the postmeta to blog2, all you'll have to do then is to filter the posts to include postmeta blog1 in blog page 1 and blog2 in blog page 2.
something like:
$args = array('meta_query' => array(
array(
'key' => 'blogPage',
'value' => 'blog1',
'compare' => '=',
'type' => 'text'
)) // for blog page 1
and
$args = array('meta_query' => array(
array(
'key' => 'blogPage',
'value' => 'blog2',
'compare' => '=',
'type' => 'text'
)) // for blog page 2

Write hyperlink inside the Zend Form and use routes?

I am having a Log-in form and want to add a "Lost Password" Link inside. I found out that you can use the description to do so. But I have now started to change everything to work with routes and would like to use this also for the Forgot Password Link. is there any chance to do this? I can't find a solution, anyone of you who knows how to do it?
$password = new Zend_Form_Element_Password('login_password', array(
'label' => 'Password',
'description' => 'Forgot Password ?',
'required' => true,
));
$password->getDecorator('description')->setOptions(array('escape' => false, 'placement' => 'APPEND'));
I've faced the same problem before, and got answer at
Write hyperlink inside the Zend Form?
May help you also...
When creating a Zend_Form, you don't have access to View_Helpers, as a form does not require a view instance. Therefore you either have to fetch a view in your form's init-method or add the description later (I prefer the latter).
When doing it the first way, you have to fetch the Zend_Controller_Front-instance and then its view, finally call a view helper, e.g. Zend_View_Helper_Url from that view.
The latter can be achieved by adding the description later on, e.g. when you passed the form to your view (or in your controller before passing it to the view):
<?php
$description = '<a href="' . $this->url([...]); . '"'>forgot password?</a>
$this->form->getElement('login_password')->setDescription($description);
echo $this->form;
?>