Ingen lister ved hjelp av stilarket

Her er både spørsmål og gode idéer/forslag

Moderators: Per Yngve Berg, sone12

Locked
User avatar
johneliassen
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 202
Joined: Tue Nov 20, 2007 12:44 pm

Ingen lister ved hjelp av stilarket

Post by johneliassen » Wed Apr 30, 2008 11:58 pm

Hvordan kan man tvinge et felt som blir påvirket av lister, til ikke å ligge under en <ul> / <li> funksjon gjennom stilarket?

Løste dette med float: left;

-------------------------------------------------------------------------------------------------------------------------------------------------

Er det noen her som har erfaring med en modul kalt mod_tab_news?
Dette er en modul som tillater switching mellom kategorier for å se siste publiserte nyhet i valgt kategori. Denne har vi altså valgt å ta i bruk på vår side, men sliter med siste finpuss 8)

Dette er mod_tab_news.php

Code: Select all

<?php

/*----------------------------------------------------------------------

#My Categorie Tabs - 

# ----------------------------------------------------------------------

# Copyright (C) 2007 You Joomla. All Rights Reserved.

# Designed by: Youjoomla.com

# License: GNU, GPL  index.php 

# Website: http://www.youjoomla.com

------------------------------------------------------------------------*/

  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.');



  require_once($mosConfig_absolute_path . '/modules/mod_tab_news/tools_ryshkin.php');



  $items_source=$params->get('items_source');

  $work_category=$params->get('work_category');

  $rm=$params->get('rm');

  $il=$params->get('il');

  $work_section=$params->get('work_section');

  $class_fx=$params->get('moduleclass_sfx');

  $links_count=$params->get('links_count');

  $char_count=$params->get('char_count');

  $linkimg_height=$params->get('limg_height');

  $linkimg_width=$params->get('limg_width');

  $show_linkimga=$params->get('show_linkimga');

  $image_height=$params->get('image_height');

  $image_width=$params->get('image_width');

  $showrow=$params->get('showrow');

  $showlinksonly=$params->get('showlinksonly');

  $tabmethod=$params->get('tabmethod');

  $introimgshow=$params->get('introimgshow');

  $tlc=$params->get('tlc');

  $tlch=$params->get('tlch');

  $itc=$params->get('itc');

  $rmlc=$params->get('rmlc');

  $rmlch=$params->get('rmlch');

  $alc=$params->get('alc');

  $alch=$params->get('alch');

  $cata=$params->get('cata');

  $cath=$params->get('cath');

  $phpversion=$params->get('phpversion',"1");





  global $mosConfig_live_site;

  global $_MAMBOTS;

  echo "<!-- http://www.Youjoomla.com  My Categorie Tabs for Joomla 1.0 starts here -->	";



   $linktag_tabs = '<link rel="stylesheet" type="text/css" href="'.$mosConfig_live_site.'/modules/mod_tab_news/mod_tab_news_style.css" />';

  $linktag_tabs.= '<script src="'.$mosConfig_live_site.'/modules/mod_tab_news/server_tab_news.js" type="text/javascript"></script>';

  $slyle_b="<style type=\"text/css\">";

  $slyle_b.="

  a.tnews_newstitle_c {

		color: {$tlc};

  }

  a.tnews_newstitle_c:hover{

	color: {$tlch};

  }



  a.tnews_rm_c {

	color: {$rmlc};

  }

  a.tnews_rm_c:hover{

	color: {$rmlch};

  }



 .moduletabletnews_ a.tnews_al_c {

	color:{$alc};

}

 .moduletabletnews_ a.tnews_al_c:hover {

color:{$alch};

}

.more a{

color:{$alc};

}

.more a:hover{

color:{$alch};

}

a.tnews_tab_off, a.tnews_tab_off:active, a.tnews_tab_off:focus{

color: {$cata};

}

a.tnews_tab_off:hover,a.tnews_tab_on:hover{

color:{$cath};

}

a.tnews_tab_on, a.tnews_tab_on:active, a.tnews_tab_on:focus{

color: {$cath};

}

.intro{

color:{$itc};

}

";

  $slyle_b.="</style>";

  $linktag_tabs.=$slyle_b;

  //-------THIS FUNCTION IS FOR PHP 5 AND UP---------

 if ( $phpversion = 1 ) {

  //-------THIS FUNCTION IS FOR PHP 5 AND UP---------

function injectCustomHeadTags($linktag_tabs) {

   $buf = ob_get_contents();

   if (!empty($buf) && !headers_sent()) {

      $buf = preg_replace("/<head(| .*?)>(.*?)<\/head>/is", "<head$1>$2".$linktag_tabs."</head>", $buf, 1, $count);

      if ($count == 1) {

         ob_clean();

         echo $buf;

         return true;

      }

   }

   return false;

}

if (!injectCustomHeadTags($linktag_tabs)) {

   echo $linktag_tabs;

}

}

//-- UNCOMENT THIS  FUNCTION AND COMENT THE ONE ON THE TOP IF YOU ARE USING PHP4

else if ( $phpversion == 2 ) {

function injectCustomHeadTags($linktag_tabs) {

   $buf = ob_get_contents();

   if (!empty($buf) && !headers_sent()) {

      ob_clean();

      echo preg_replace("/<head(.*?)>(.*?)<\/head>/is", "<head$1>$2".$linktag_tabs."</head>", $buf);

      return true;

   }

   return false;

}

if (!injectCustomHeadTags($linktag_tabs)) {

   echo $linktag_tabs;

}

}



  // --------------------------------END -------------------------------------------







  /*

  $img_width=$params->get('img_width');

  $img_height=$params->get('img_height');

  */



  $tab_num_columns=$params->get('tab_num_columns');

  $image_align=$params->get('image_align');









  $now 		    = _CURRENT_SERVER_TIME;

  $access 	    = !$mainframe->getCfg( 'shownoauth' );

  $nullDate 	= $database->getNullDate();

  $my           = $mainframe->getUser();

  $gid          = intval($my->gid);





  if ($items_source==0)

  {

     $query = 'SELECT a.id,a.name,a.ordering  FROM #__categories AS a WHERE (a.section='.$work_section.') and (published=1)  ORDER BY  a.ordering';

  }

  if ($items_source==1)

  {

     $query = 'SELECT a.id,a.name,a.ordering  FROM #__categories AS a WHERE (a.id='.$work_category.') and (published=1)  ORDER BY  a.ordering';

  }

  $database->setQuery($query);

  $rows = $database->loadObjectList();



  echo "<div>\n";

//echo "<div id=\"karnav\">";



  // output tabs

  $count_tab=0;

  foreach ($rows as $row)

  {

     $query = "SELECT a.images, a.introtext, a.id, a.title, a.sectionid, a.catid, cc.title as cattitle"

			. "\n FROM #__content AS a"

			. "\n INNER JOIN #__categories AS cc ON cc.id = a.catid"

			. "\n WHERE ( a.state = 1 AND a.sectionid > 0 "

			. "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"

			. "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"

			. ( $access ? "\n AND a.access <= $my->gid AND cc.access <= $my->gid" : '' )

			. "\n AND cc.published = 1 )"

			. "\n AND (a.catid=".$row->id.")"

			. "\n ORDER BY a.created ASC";

	 if ($items_source==0)

     {

        $query.=" LIMIT 0,".($links_count+1);

     }



     $database->setQuery($query);

     $rows2 = $database->loadObjectList();



     if ($items_source==1)

     {

      $total_count_items=count($rows2)-1;

      //$links_count=0;

     }else

     {

      $total_count_items=0;

     }

     $current_item_id=0;

     //while (($current_item_id<=$total_count_items)&&(isset($rows2[$current_item_id]->title)))

     {

     if (isset($rows2[0]->title))

     {

	 //show tabs

//	    

//		echo "";

//		echo "";

	 if($tabmethod==1){

       if ($count_tab==0)

	   

       {

	


		 echo "<td id='newspanel-title' align='left'>";
		 
         echo "<div class='newspanel-nav'><a class='newspanel-nav' href=\"javascript: void(0);\" onmouseover=\"javascript:swith_tab('".$class_fx."tab_',".$row->id.");return(false);\"><span>".$row->name."</span></a></div>\n";



       }else

       {

         echo "<div class='newspanel-nav'><a class='newspanel-nav' href=\"javascript: void(0);\" onmouseover=\"javascript:swith_tab('".$class_fx."tab_',".$row->id.");return(false);\"><span>".$row->name."</span></a></div>\n";

		 echo "</td>";

       }

	   

	   }

//	   echo "";

//		echo "";

	   //end

	//   echo "";

//		echo "";

	   if($tabmethod==2){

       if ($count_tab==0)

	   

       {

	   

         echo "<div class='newspanel-nav'><a id=\"".$class_fx."tab_a_".$row->id."\" class=\"".$class_fx."tab_on\" title=\"".$row->name."\"  href=\"javascript: void(0);\" onclick=\"javascript:swith_tab('".$class_fx."tab_',".$row->id.");return(false);\"><span>".$row->name."</span></a>\n";



       }else

       {

         echo "<div class='newspanel-nav'><a id=\"".$class_fx."tab_a_".$row->id."\" class=\"".$class_fx."tab_off\" title=\"".$row->name."\"  href=\"javascript: void(0);\" onclick=\"javascript:swith_tab('".$class_fx."tab_',".$row->id.");return(false);\"><span>".$row->name."</span></a></div>\n";


       }

	   

	   }

//	    echo "";

//		echo "";

	   //end

       $count_tab++;

     }

       $current_item_id++;

     }

  }

//  echo '</div>';

   

	//echo "<div id=\"movediv\">";

  // output category content

  $count_tab=0;

  foreach ($rows as $row)

  {

     $query = "SELECT a.images, a.introtext, a.id, a.title, a.sectionid, a.catid, cc.title as cattitle"

			. "\n FROM #__content AS a"

			. "\n INNER JOIN #__categories AS cc ON cc.id = a.catid"

			. "\n WHERE ( a.state = 1 AND a.sectionid > 0 "

			. "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"

			. "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"

			. ( $access ? "\n AND a.access <= $my->gid AND cc.access <= $my->gid" : '' )

			. "\n AND cc.published = 1 )"

			. "\n AND (a.catid=".$row->id.")"

			. "\n ORDER BY a.ordering";

    // if ($items_source==0)

     {

        $query.=" LIMIT 0,".($links_count+1);

     }

     $database->setQuery($query);

     $rows2 = $database->loadObjectList();



     if ($items_source==1)

     {

      $total_count_items=count($rows2)-1;

     // $links_count=0;

     }else

     {

      $total_count_items=0;

     }



     $img_url="";

     if (isset($rows2[0]->title))

     {

       if ($count_tab==0)

       {
         echo "<br />";
         echo "<div id=\"".$class_fx."tab_".$row->id."\" class=\"".$class_fx."tab\">\n";

       }else

       {

         echo "<div id=\"".$class_fx."tab_".$row->id."\" class=\"".$class_fx."tab\" style=\"display: none;\">\n";

       }



       $count_tab++;

       echo "<div class=\"".$class_fx."newscontent\">\n";



       // output image

       processImagesCustom($rows2[0]);

       $introtext=$rows2[0]->introtext;

       $find_img=strpos($introtext,"img");

       if ($find_img)

       {

         $end_img=strpos($introtext,"src=",$find_img);

         if ($end_img)

         {

           $j=$end_img;

           while (($introtext[$j]!='"')||($j<count($introtext)))

           {

             $img_url.=$introtext[$j];

             $j++;

             if ($img_url=="src=")

             {

               $img_url="";

               $j++;

             }

           }

         }

       }





       $Itemid =  $mainframe->getItemid($rows2[0]->id);

       if ($Itemid == NULL) {

   	      $Itemid = '';

       } else {

	      $Itemid = '&Itemid='. $Itemid;

       }

       $url_content="index.php?option=com_content&task=view&id=".$rows2[0]->id.$Itemid;





       if ($img_url!="")

       {



         $img_out="";

         if ($il==0)

         {

           $img_out.="<a href=\"".sefRelToAbs($url_content)."\">\n";

         }

        if ($image_align!="")

          {

            $img_out.="<img class=\"".$class_fx."img_news\" src=\"".$img_url."\" align=\"".$image_align."\" title=\"".$rows2[0]->title."\" width=\"".$image_width."\" height=\"".$image_height."\" border=\"0\"  alt=\"".$rows2[0]->title."\"/>\n";

          }else

          {

            $img_out.="<img class=\"".$class_fx."img_news\" src=\"".$img_url."\" align=\"left\" border=\"0\" title=\"".$rows2[0]->title."\" width=\"".$image_width."\" height=\"".$image_height."\" alt=\"".$rows2[0]->title."\"/>\n";

          }

         if ($il==0)

         {

           $img_out.="</a>\n";

         }

		 if($introimgshow ==1){

         echo($img_out);}

		  if($introimgshow ==2){

         echo"";}

       }



//intro



       echo "<a href=\"".sefRelToAbs($url_content)."\" class=\"".$class_fx."newstitle_c\" title=\"".$rows2[0]->title."\">".$rows2[0]->title."</a>\n";

       $content_intro=substr(strip_tags($rows2[0]->introtext,"<b><strong>"),0,$char_count)."..";



       if ($rm==0)

       {

         $content_intro.="<a href=\"".sefRelToAbs($url_content)."\" class=\"".$class_fx."rm_c\"><b><br />Les Mer</b></a>\n";

       }



       echo "<div class=\"intro\"  style=\"color:".$itc.";\">\n";

       echo($content_intro);

	     echo"</div>";

	   

	   

	   //end

       echo "</div>\n";



       echo "<div class='newspanel-nav'>\n";

       echo "<br/>\n";

      // echo "<br/>\n";

     

       $out_links="";

	   //rows

	   if ($showrow == 1){

       

       if (isset($rows2[1]->title))

       {

         $out_links.="<ul class=\"".$class_fx."newslinks\">\n";

       }

	   

	   

	   // end rows

       }



      echo "<br/>\n";

      for ($i=1;$i<=$links_count;$i++)

       {

        if (isset($rows2[$i]->title))

        {

		//rows

		 if ($showrow == 1){

       $out_links.="\n";

	   }

	   

	   

	   // end rows



          $Itemid =  $mainframe->getItemid($rows2[$i]->id);

          if ($Itemid == NULL) {

   	        $Itemid = '';

          } else {

	        $Itemid = '&Itemid='. $Itemid;

          }





          $url_content="index.php?option=com_content&task=view&id=".$rows2[$i]->id.$Itemid;



           $img_url="";

           processImagesCustom($rows2[$i]);

            $introtext=$rows2[$i]->introtext;

            $find_img=strpos($introtext,"img");

            if ($find_img)

            {

              $end_img=strpos($introtext,"src=",$find_img);

              if ($end_img)

              {

                $j=$end_img;

                while (($introtext[$j]!='"')||($j<count($introtext)))

                {

                  $img_url.=$introtext[$j];

                  $j++;

                  if ($img_url=="src=")

                  {

                    $img_url="";

                    $j++;

                  }

                }

              }

             }

if ($show_linkimga == 1){



           $out_links.="<a href=\"".sefRelToAbs($url_content)."\" class=\"".$class_fx."al_c\">";







            if ($img_url!="")

            {



              $out_links.="<img class=\"".$class_fx."img_news2\" src=\"".$img_url."\"  width=\"".$linkimg_width."\" height=\"".$linkimg_height."\" border=\"0\" alt=\"".$rows2[0]->title."\"/>";

            }

            $out_links.="&nbsp;".$rows2[$i]->title."</a>";}



if ($show_linkimga == 0){



           $out_links.="<a href=\"".sefRelToAbs($url_content)."\" class=\"".$class_fx."al_c\">";



            $out_links.="&nbsp;".$rows2[$i]->title."</a>";}

            // $out_links.="<a href=\"".sefRelToAbs($url_content)."\" class=\"".$class_fx."add_link\">";



            // $out_links.=$rows2[$i]->title."</a>";

			if ($showrow == 1){

             $out_links.="\n";}

        }

      }

if ($showrow == 1){

      

      if (isset($rows2[1]->title))

      {

        $out_links.="\n";}

      }

      

      echo ($out_links);

       $url_section="index.php?option=com_content&task=category&sectionid=".$work_section."&id=".$row->id.$Itemid;

       $CAT_TITLE="<a href=\"".sefRelToAbs($url_section)."\" class=\"".$class_fx."newscat\" title=\"".$row->name."\"><b>Kategori</b> ".$row->name."</a>\n";

	   

	   echo "<div class=\"more\">";

echo  $CAT_TITLE;

echo "</div>\n";

      echo "</div>\n";



      echo "</div>\n";

     }

  }

    echo "</div>\n";



// echo '</div>';



echo "<!-- http://www.Youjoomla.com My Categorie Tabs for Joomla 1.0 ends here -->	";

  /*

    <param name="img_width" type="text" default="75" label="Image Width (px)" description="Image Width (px)" />

    <param name="img_height" type="text" default="75" label="Image Height (px)" description="Image Height (px)" />

  */

?>
Dette er utsenede på siden nå:
Image

Slik skal det se ut:
men jeg vet ikke helt hvor i php-filen jeg må echo'e hva for å få den til å bli påvirket av stilarket tilegnet "tittel-linjen" hvor de ulike kategoriene ligger slik at man kan trykke på linkene i tittel-linjen så kommer dem i rammen under...

Image


Stilarket jeg ønsker skal påvirke den topplinjen:

Code: Select all

#newspanel-title {
	height: 16px;
	padding: 4px;
	padding-top: 8px;
	width: 100%;
	background-color: #D7D7CB;
	color: #787972;
	margin: 0px 0px 0px 4px;
	font-size: 10px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	float: left;
}

Locked

Return to “Template, CSS og design”