Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi initialhit,

    You might not need to change the PHP to do this. Have you tried using custom CSS to alter the width of the div that encloses the widget? That shouldn’t be too hard using Firebug (https://getfirebug.com)

    That, plus a custom CSS file for AWPCP (article here: https://www.awpcp.com/forum/viewtopic.php?f=3&t=1234) ought to do it.

    Thread Starter initialhit

    (@initialhit)

    will give it a shot! Just making sure it wasn’t hard coded.

    Hi, same here.

    I actually tried to define my own css prefix.
    But the search do not change.

    The actually result you see on .

    I want a margin between the words, you know?
    I want to change the search button an the search field.

    I would be glad for any Help.

    Thank you and best regards from Germany

    David

    Hi David,

    Read the Custom CSS link above–it tells you how to use Firebug to find these elements and make the right adjustments in the custom CSS file.

    Your theme will handle these a little differently from all other themes (that’s the point–for themes to have a unique look!), so I can’t offer generic advice on it. You’ll need to inspect elements with Firebug and find them, try changes, and then save them in the custom CSS file.

    Thank`s, i will have another try this night.
    If i won`t get i will you have notice.

    Thread Starter initialhit

    (@initialhit)

    Hey,
    got it work… but it’s not as simple as you put it.
    So how WP handles stuff in the footer made it fun.
    First and foremost… wordpress core manipulates it, your theme of choice has a hand in manipulating the widget area, wordpress core manipulates it, and then it gets to your actual widget. In order for me to get it to work I had to do some cleanup on your widget, deleting all your <divs>, which it automatically will only generally put one of those per line unless you place the layer tag on them. The item that was causing problems was the
    <li> and
    <ul> tags, replaced them <td> and <tr>, respectively. Then I had to remove the <h3> tag and replace it with the tag. Code of the mod on your widget is below:

    function awpcp_sidebar_headlines($limit, $showimages, $showblank, $show_title, $show_excerpt) {
        $output = '';
        global $wpdb,$awpcp_imagesurl;
        $tbl_ads = $wpdb->prefix . "awpcp_ads";
    
        $awpcppage=get_currentpagename();
        $awpcppagename = sanitize_title($awpcppage, $post_ID='');
        $permastruc=get_option('permalink_structure');
        $quers=setup_url_structure($awpcppagename);
        $displayadthumbwidth = intval(trim(get_awpcp_option('displayadthumbwidth'))) . 'px';
    
        if(!isset($limit) || empty($limit)){
            $limit = 10;
        }
    
        $query = "SELECT ad_id,ad_title,ad_details FROM ". AWPCP_TABLE_ADS ." ";
        $query.= "WHERE ad_title <> '' AND disabled = 0 ";
        // $query.= "AND (flagged IS NULL OR flagged = 0) ";
        $query.= "ORDER BY ad_postdate DESC, ad_id DESC LIMIT ". $limit . "";
        $res = awpcp_query($query, __LINE__);
    
        while ($rsrow=mysql_fetch_row($res)) {
    
            $ad_id=$rsrow[0];
            $modtitle= awpcp_esc_attr($rsrow[1]);
            $hasNoImage = true;
            $url_showad=url_showad($ad_id);
    
            $ad_title="<a href=\"$url_showad\">".stripslashes($rsrow[1])."</a>";
            if (!$showimages) {
                //Old style, list only:
                $output .= "$ad_title";
            } else {
                //New style, with images and layout control:
                $awpcp_image_display="<a  href=\"$url_showad\">";
                if (get_awpcp_option('imagesallowdisallow')) {
                    $totalimagesuploaded=get_total_imagesuploaded($ad_id);
                    if ($totalimagesuploaded >=1) {
    		    $displayadthumbwidth = "175px";
                        $image = awpcp_get_ad_primary_image($ad_id);
                        if (!is_null($image)) {
                            $awpcp_image_name_srccode="<img src=\"" . awpcp_get_image_url($image) . "\" border=\"0\" width=\"$displayadthumbwidth\" alt=\"$modtitle\"/>";
                            $hasNoImage = false;
                        } else {
                            $awpcp_image_name_srccode="<img src=\"$awpcp_imagesurl/adhasnoimage.gif\" width=\"$displayadthumbwidth\" border=\"0\" alt=\"$modtitle\"/>";
                        }
                    } else {
                        $awpcp_image_name_srccode="<img src=\"$awpcp_imagesurl/adhasnoimage.gif\" width=\"$displayadthumbwidth\" border=\"0\" alt=\"$modtitle\" />";
                    }
                } else {
                    $awpcp_image_name_srccode="<img src=\"$awpcp_imagesurl/adhasnoimage.gif\" width=\"$displayadthumbwidth\" border=\"0\" alt=\"$modtitle\"/>";
                }
    
                $ad_teaser = stripslashes(substr($rsrow[2], 0, 50)) . "...";
                $read_more = "<a href=\"$url_showad\">[" . __("Read more", "AWPCP") . "]</a>";
                $awpcp_image_display.="$awpcp_image_name_srccode</a>";
    
                $awpcp_image_display = (!$showblank && $hasNoImage) ? '' : $awpcp_image_display;
                $html_title = "<strong>$ad_title</strong>";
                $html_excerpt = $show_excerpt ? "<p>$ad_teaser<br/>$read_more</p>" : '';
    
                $output .= "<td>$awpcp_image_display  $html_title $html_excerpt</td>";
            }
        }

    [Moderator note: Please wrap all code in backticks]

    Thread Starter initialhit

    (@initialhit)

    I decided I didn’t want text associated, so I also commented out these two lines like such:

    //$html_title = "<strong>$ad_title</strong>";
    //$html_excerpt = $show_excerpt ? "$ad_teaser<br/>$read_more" : '';

    In the end, the way I am doing it bypasses all of the themes and WP-Core css manipulations as they don’t have anything for xhtml tags like … took me about 6 hours to get it, but enjoy everyone ??

    Thread Starter initialhit

    (@initialhit)

    and instead of firebug, you can use inspect element in chrome as well ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Plugin widget mod help’ is closed to new replies.