Fork me on GitHub

block that remain in the same position althougth was changed in admin blocks panel  Bottom

  • Hello in the zikula version that i am migrating from postnuke, i have a block named recent_and_top_news.php that it is located in \config\blocks, that remain in the same position althougth was changed in admin blocks panel. Always is placed in the top of the center blocks positions.... i dont know why...
    In the blocks admin panel you can see it in the position that i want but the reallity is that the block always reamain in the top of all the center blocks...
    some idea????

    this is my block i do not see nothing wrong...this block shows the top read news and the last read news...


    Code

    /********************************************************/
    /* Storms mod ver of recent and top news 1.5d           */
    /* Greatly enhnaced functions added by StormS           */
    /* http:// www.sapperbase.com                           */
    /*                                                      */
    /* Orginal file taken from Raider at raider.microp.com  */
    /********************************************************/

        $blocks_modules['recent_and_top_news'] = array(
        'func_display'              => 'recent_and_top_news_display',
        'func_add'                  => 'recent_and_top_news_add',
        'func_edit'                 => 'recent_and_top_news_edit',
        'func_update'               => 'recent_and_top_news_update',
        'text_type'                 => 'Recent and Top News',
        'text_type_long'            => 'Recent and Top News Block',
        'allow_create'   => false,
        'allow_multiple' => true,
        'allow_delete'   => false,
        'form_content'   => false,
        'form_refresh'   => false,
        'show_preview'   => true
    );
    pnSecAddSchema("recent_and_top_news::", "Block title:Link name:");

    function recent_and_top_news_display($row)
    {
            list($dbconn) = pnDBGetConn();
            $pntable = pnDBGetTables();

    if (!pnSecAuthAction(0, 'recent_and_top_news::', "$row[title]::", ACCESS_READ)) {
                    return;
            }

    // CONFIGS BY STORMS //
    $image = "<img src=\"images/recenttopnews/hbullet.gif\">"; // Image show next to the downloads
    $image2 = "<img src=\"images/recenttopnews/triright.gif\">"; // Image show next to the headlines
    $image3 = "<img src=\"images/recenttopnews/pixel.gif\">"; // Transparant gif to keep border equal to 1 pix in both IE og Netscape
    $bgcolor1 = 'bgcolor=#C1CDE6'; // Background color underneath the headlines to the left (recent headlines)
    $bgcolor2 = 'bgcolor=#F9F9F9'; // Background color second columm in left block (recent headlines)
    $bgcolor3 = 'bgcolor=#FFFFFF'; // Background color underneath the headlines to the right (most headlines)
    $bgcolor4 = 'bgcolor=#F9F9F9'; // Background color second columm in right block (most read headlines)
    $bottomborder = "bgcolor=\"#C1CDE6\""; // Line color between the listings
    // END //


      echo "<table border=\"0\" align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">"
      ."<tr><td width=\"50%\" valign=\"top\" align=\"left\">";
      echo "<table border=\"0\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" align=\"center\">
                           <tr><td $bgcolor1 align=left width=\"100%\">$image2&nbsp;&nbsp;<font class=\"pn-title\">"
    ._Recent_Headlines."</font></td></tr>
                           </table>\n"
    ;

    //
    //        
            $url = explode('|', $row['url']);
            if (!$url[0])
        {
          $url[0] = 5;
        }
           
            if (!$url[1])
            {
              $url[1] = 36;
            }
           
            if (!$url[2])
            {
              $url[2] = 29;
            }
           
            $amount = $url[0];
            $maxlength = $url[1];
            $length = $url[2];
           
           
            $table = $pntable['stories'];
            $column = &$pntable['stories_column'];
           
            $sql = "SELECT $column[sid], $column[lu_uid],
                    $column[title], UNIX_TIMESTAMP($column[from]) FROM $table where $column[published_status] = 0
                    ORDER BY
                    $column[from] DESC LIMIT $amount "
    ;
           
            $result = $dbconn->Execute($sql);
            while (list($sid, $lu_uid, $title, $from) = $result->fields) {
                    $datetime = date("d.m.y",$from);
                    $result->MoveNext();
                                    if (strlen($title) > $maxlength) {
                                    $title = substr($title,0,$length);
                                    $title .= "...";    
           
         }

                   echo "<table border=\"0\" align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n"
                   ."<tr><td width=\"70%\" valign=\"top\">$image&nbsp;
                   <span class=\"pn-normal\">\n"

                   ."<a href=\"index.php?module=News&func=display&sid=$sid\" style=\"text-decoration:none\"> ".stripslashes($title)."</a>
                   </span></td>\n"
     
     /* ."<a href=\"modules.php?op=modload&name=News&file=article&sid=$sid\" style=\"text-decoration:none\"> ".stripslashes($title)."</a></span></td>\n"                                                            */
                   ."<td $bgcolor2 width=\"30%\" align=\"right\"><font class=\"pn-normal\"><small>$datetime</small></font></td>\n"
                   ."</tr></table>\n";
    /*           echo "<table $bottomborder border=\"0\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" align=\"center\" border=\"0\">
                           <tr ><td></td></tr>
                           </table>\n"; /*                     <tr ><td>$image3</td></tr> */

                   
                       
         }
               
                     echo "</td><td width=50% valign=top align=left>\n";
                                   
    /**
     * Top 10 read stories - code taken from Top_List module
     */

    echo "<table cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" align=\"center\" border=\"0\">
                           <tr><td bgcolor3 align=left width=\"100%\">$image2&nbsp;&nbsp;<font class=\"pn-title\">"
    ._Most_Read_Stories."</font></td></tr>
                           </table>\n"
    ;
                                               
    list($dbconn) = pnDBGetConn();
    $pntable = pnDBGetTables();
    $column = &$pntable['stories_column'];
    $myquery = buildSimpleQuery ('stories', array ('sid', 'title', 'counter'), $queryalang, "$column[counter] DESC", $amount);
    $result2 = $dbconn->Execute($myquery);

    if (!$result2->EOF) {  
       

        while(list($sid, $title, $counter) = $result2->fields) {

           
                if (strlen($title) > $maxlength) {
                                    $title = substr($title,0,$length);
                                    $title .= "...";}  
               echo "<table align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
               
               echo "<tr><td width=70%>$image&nbsp;<font class=\"pn-normal\"><a href=\"index.php?module=News&func=display&sid=$sid\" style=\"text-decoration:none\">" . pnVarPrepForDisplay($title) . "</a></font></td>";
                /* echo "<tr><td width=70%>$image&nbsp;<font class=\"pn-normal\"><a href=\"modules.php?op=modload&amp;name=News&amp;file=article&amp;sid=$sid\" style=\"text-decoration:none\">" . pnVarPrepForDisplay($title) . "</a></font></td>"; */
               
                echo "<td $bgcolor4 width=30% align=right><font class=\"pn-normal\"><small>$counter "._Reads_on_page."</small></font></td>";
                echo "</tr></table>\n";
    /*          echo "<table $bottomborder border=\"0\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" align=\"center\" border=\"0\">
                           <tr ><td></td></tr>
                           </table>\n"; //*                        <tr ><td>$image3</td></tr> */

                           $result2->MoveNext();
             }    echo "<div align=\"right\"><a href=\"modules.php?op=modload&amp;name=News&amp;file=index\" style=\"text-decoration:none\"><font class=\"pn-block\"><b><small>["._More_News."]</b><small></a></font></div>";          
                     
            echo "</td></tr></table>\n";  

          }
    //if (empty($row['title'])) {            
            //$row['title'] = _Titletopnews;    
            //}

            //$row['content'] = $content;
            //themesidebox($row);

     }
             


    function recent_and_top_news_add($row)
    {
        $row['url'] = '5|36|29';
        return $row;
    }

    function recent_and_top_news_edit($row)
    {
    if (!empty($row['url'])) {
            $url = explode('|', $row['url']);
                    $amount = $url[0];
                    $mlength = $url[1];
                    $length = $url[2];
        }

            $version = "1.0";
            $editshow = "<tr><td height=10></td></tr><tr><td align=left><b>"._Recent_Top_Block_Conf."</b></td>"
                                  ."</tr><tr><td align=left>"._Version.": $version</td></tr>"
                                    ."<tr><td>"._Display_X_Headlines.""._Inbothblocks.":</td><td>"
                                    ."<input type=\"text\" name=\"amount\" size=\"10\" maxlength=\"255\" value=\"$amount\" class=\"pn-normal\"></td></tr>"
                                    ."<tr><td>"._Iflength.":</td><td><input type=\"text\" name=\"mlength\" size=\"10\" maxlength=\"255\" value=\"$mlength\" class=\"pn-normal\">"
                                    ."&nbsp;"._Limitto.": <input type=\"text\" name=\"length\" size=\"10\" maxlength=\"255\" value=\"$length\" class=\"pn-normal\"></td></tr>";
            return $editshow;
    }

    function recent_and_top_news_update($vars)
    {
        $vars['url'] = "$vars[amount]|$vars[mlength]|$vars[length]";
        return $vars;
    }


    ?>




    edited by: mercromina, datetimebrief

    --
    www.ahorradores.net

This list is based on users active over the last 60 minutes.