Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter BARBAROUX

    (@barbaroux)

    on server side, this is the main function used :

    function appel_crp($po) {
    
           $li=6;
            
           $thumb_height=140;
           $thumb_width=140;
           $thumb_meta="post-image";
           $thumb_html="html";
           $thumb_default="";
           $thumb_default_show=true;
           $thumb_timthumb="";
           $thumb_timthumb_q="";
           $scan_images=false;
           
           
           if ( function_exists( 'get_crp_posts' ) )
           {
               $results = get_crp_posts(array ('postid' => $po, 'limit' => $li));
               if ($results) {
                   $output='<div class="crp_related crp_related_widget crp-grid"><ul>';
                   foreach ($results as $result)
                   {
                       $output.="<li>";
                       
                       $output .= '<a href="' . get_permalink($result->ID) . '" ' . $rel_attribute . ' ' . $target_attribute . '>';
                       $output .= crp_get_the_post_thumbnail(array('post' => $result->ID, 'thumb_height' => $thumb_height, 'thumb_width' => $thumb_width, 'thumb_meta' => $thumb_meta, 'thumb_html' => $thumb_html, 'thumb_default' => $thumb_default, 'thumb_default_show' => $thumb_default_show, 'thumb_timthumb' => $thumb_timthumb, 'thumb_timthumb_q' => $thumb_timthumb_q, 'scan_images' => $scan_images, 'class' => 'crp_thumb', 'filter' => 'crp_postimage'));
                       
                       $output.='<span class="crp_title">';
                       $output.= get_the_title($result->ID);
                       $output.='</span>';
                       $output .= '</a>';
                       $output.="</li>";
                       
                   }
                   $output.="</div><ul>";
                   return $output;
               } else
                   return "Pas d'articles relatifs";
           }
               else
                   return "fonction inexistante";
         
       }

    the result is json encapsulated then returned to the client side and managed by javscript.

    Thread Starter BARBAROUX

    (@barbaroux)

    Hi Ajay, it’s ok now.
    I’ve used get_crp_posts() in my php code thru an ajax mechanism.
    it works fine on my resume-cv blog. I use it to delay the display of some bottom information.
    many thanks for your advices and all the work on your plugins.
    kind regards.

    Thread Starter BARBAROUX

    (@barbaroux)

    Hi,
    I’ve just seen
    get_crp_posts() on your website webberzone.com
    would it be not more convinient to use it ?
    regards,

    Thread Starter BARBAROUX

    (@barbaroux)

    Hi Ajay,

    thanks for your quick response.

    well I use
    if ( function_exists( ‘echo_crp’ ) ) { echo_crp(); }
    as line code to fetch the information from the crp plugin.

    I want to use ajax and I am aware that not in the loop so parameters (at least page_id) are needed to work fine.

    I’ll take a look at the rest api and will make response afters tests.
    regards;

    Thread Starter BARBAROUX

    (@barbaroux)

    Hi bdbrown

    it works!

    many thanks for the way you explained it with details, for your availability and your professional service.

    kind regards,
    P.BARBAROUX

    Thread Starter BARBAROUX

    (@barbaroux)

    Hi bdbrown
    I have made modifications on page.php as seen on the topic but it does not work.
    share buttons continue to appear in posts and not in pages.
    kind regards,
    P.BARBAROUX

Viewing 6 replies - 1 through 6 (of 6 total)