31
council
Re: Adding CSS to XHLDO
  • 2005/2/8 19:18

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Quote:

tripmon wrote:
You can:

1) embed the style definitions as well as the id/style tags in the block html (block info below).

2) use existing, or create new styles in the *style sheet for your theme*, link to it, and code the tags in the block html.

3) create a new style sheet and link it to and code the tags in the block html.

-------------
these are the 2 files that control the html output.
xhld0_block_rss.html - xhld/templates
xhld0_block.html - xhld/templates
-------------
this file controls the output from the 2 files above
xhld0_block_mixed.html - xhld/templates/blocks

GL


Thanks, a couple of questions though.

Are you saying I place the link in xhldo_block_mixed.html?

And if so, where? There's no "head" in this file.

Ric



32
council
Adding CSS to XHLDO
  • 2005/2/8 15:27

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


First, congradulations to all you XOOPS award winners. May the force be with you.

Question: How do I add css to my xhld0 display? I looked in the xhld0 folder. No css. Also, it doesn't appear to be inheriting the css from the page it's on.

Thanks,

Richttp://blacklogs.com



33
council
Multi-Menu Question
  • 2005/2/7 20:09

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


I've just downloaded multi-menu. I want to get rid of the left column and have a men bar running across the top.

How do I do this -- can I do this?

Ric



34
council
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/7 7:21

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Ok, Rowd, figured out why I was getting the error message, fixed it, then tried your code and I'm happy to report it worked like a charm.

Now, another question:

Direcly below is the code I'm working with. It's an rss feed with links that open up in a new browser window. I want these links to open a new window of say 500 x 500 so I don't lose the visitor. This new window should have a back button.

This code comes from a product called "carp" Carp parses rss feeds.

The instructions for targeting link with Carp say this:

*******************************

# linktarget ("link target") : Specifies which window or frame to open links in. Specify one of the following values:

* 0 (the default): the current window (and frame, if in a frame set)
* 1: a new window
* 2: the same window, but ensure that it is not in a frame
* the name of a frame if in a frameset, or the name of a window (NOTE: the name must contain at least one character that is not a digit)
*************************************


Here's the link to the instructions page:

http://www.geckotribe.com/rss/carp/...y/item/link.php


To sum up: the code below comes into an html page which I load to my server. The code displays an rss link in a box. When people click on the title of this feed I want a new window to open instead of the new url opening on the current page..

Thank you.

Oh, here's my urlhttp://blacklogs.com

Ric


<div style="width:220px;border:1px solid #333333; background:#ffffff; padding:5px;">
<?php
require_once '/home/blacklog/public_html/carp/carp.php';
CarpConf('linktarget','newwin');
CarpConf('clinkclass','h2');
CarpConf('cborder', 'link,date, author, desc');
CarpConf('maxitems',1);
CarpConf('bcdesc','<i>');
CarpConf('acdesc','</i>');
CarpConf('maxcdesc',400);
CarpConf('poweredby','');
CarpCacheShow('http://blackinformant.com/wp-rss2.php');

CarpConf('clinkclass','h2');

?>
</div>



35
council
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/7 0:36

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


cancel this.



36
council
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/7 0:24

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


my module was mypage and my css was mypage.css, so that wasn't the problem. But he's what I'm getting now using the code word for word from the above:

Warning: main(): open_basedir restriction in effect. File(../../mainfile.php) is not within the allowed path(s): (/home/blacklog/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/blacklog/public_html/index.php on line 2

Warning: main(../../mainfile.php): failed to open stream: Operation not permitted in /home/blacklog/public_html/index.php on line 2

Warning: main(): open_basedir restriction in effect. File(../../mainfile.php) is not within the allowed path(s): (/home/blacklog/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/blacklog/public_html/index.php on line 2

Warning: main(../../mainfile.php): failed to open stream: Operation not permitted in /home/blacklog/public_html/index.php on line 2

Warning: main(): Failed opening '../../mainfile.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blacklog/public_html/index.php on line 2

Warning: main(XOOPS_ROOT_PATH/header.php): failed to open stream: No such file or directory in /home/blacklog/public_html/index.php on line 3

Warning: main(XOOPS_ROOT_PATH/header.php): failed to open stream: No such file or directory in /home/blacklog/public_html/index.php on line 3

Warning: main(): Failed opening 'XOOPS_ROOT_PATH/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blacklog/public_html/index.php on line 3

Fatal error: Call to a member function on a non-object in /home/blacklog/public_html/index.php on line 5



37
council
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 23:20

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Quote:

rowdie wrote:
try this:

<?php
include("../../mainfile.php");
include(
XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
$xoopsTpl->assign("xoops_module_header""<link rel='stylesheet' type='text/css' href='" XOOPS_URL "/modules/mypage/mypage.css'/>");

?>



Tried it and got a blank white page. Was I supposed to add the url of the page somewhere. It's index.php

My url ishttp://blacklogs.com

Here's the code I pasted in after removing the orginal code:

<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
$xoopsTpl->assign("xoops_module_header", "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/mypage/mypage.css'/>");

?>

Am I missing something?

Ric



38
council
Re: Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 20:57

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Quote:

rowdie wrote:
Make a separate css file and place it in your 'mypage' module folder.

In your index.php file add this code somewhere after the include XOOPS_ROOT_PATH."/header.php" In the code use your module name, php file name and your css file name instead of what I've got here, of course

$xoopsTpl->assign("xoops_module_header""<link rel='stylesheet' type='text/css' href='" XOOPS_URL "/modules/mypage/mypage.css'/>");


I haven't tested it with 'mypage' but it should work, provided you have included the header.php file first.

This will add your css file after the xoops.css file. Css works on a hierarchal basis, so any classes and elements you have in your file will replace those in the XOOPS one, as long as they have the same name.

Rowd



Thanks, Rowd, but it's a little confusing. Here's the include. Where do I stick your code above?

<?php
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
?>


Ric



39
council
Mypage Document Inherits Xoops CSS-- I don't want that!
  • 2005/2/6 17:20

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Ok, I've got mypage working fine expect for one thing: the document is inherting the css from the XOOPS style sheet instead of the css I've got in the header of index.php.

How do I fix this?

Thanks,

Ric



40
council
Re: Why are all Headline Modules Half-baked?
  • 2005/2/3 15:19

  • council

  • Not too shy to talk

  • Posts: 184

  • Since: 2004/12/18


Actually, there is a way. This site has a javascript app that does just that:

http://jade.mcli.dist.maricopa.edu/feed/

When done, the code looks like this:


<script language="JavaScript" src="http://www.blacklogs.com/feeds/feed2js.php?src=+%09http%3A%2F%2Fellesgarden.blogs.com%2Fellesgarden%2Fatom.xm&chan=n&num=0&desc=0&date=n&targ=n&html=n" type="text/javascript"></script>

<noscript>
<a href="http://www.blacklogs.com/feeds/feed2js.php?src=+%09http%3A%2F%2Fellesgarden.blogs.com%2Fellesgarden%2Fatom.xm&chan=n&num=0&desc=0&date=n&targ=n&html=y">View RSS feed</a>
</noscript>

but this involves an rss parser (magpie) and the javascript working together. My problem with it is that it's not as fast as xhld0. I need 20 feeds on my front page.


Now what I'm wondering is if I could hack the xhld0 blocks. Here's the code in these blocks:

Quote:
if( ! defined( 'XHLD_BLOCK_INCLUDED' ) ) { define( 'XHLD_BLOCK_INCLUDED' , 1 ) ; $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ; include_once XOOPS_ROOT_PATH."/modules/$mydirname/include/functions.php"; function b_xhld_show( $options ) { $mydirname = empty( $options[0] ) ? basename( dirname( dirname( __FILE__ ) ) ) : $options[0] ; $cols = empty( $options[1] ) ? 1 : intval( $options[1] ) ; $maxlen = empty( $options[2] ) ? 128 : intval( $options[2] ) ; $extraction = empty( $options[3] ) ? 'A' : $options[3] ; $criteria = new CriteriaCompo(); $criteria->add( new Criteria('headline_asblock', 1) ) ; if( substr( $options[3] , 0 , 1 ) == 'F' ) { // displaying only a feed $criteria->add( new Criteria('headline_id', intval( substr( $options[3] , 1 ) ) ) ) ; } // displaying feeds belongs the specified category (not yet) global $xoopsConfig; $block = array(); $block['feeds'] = array() ; $hlman =& xoops_getmodulehandler('headline', $mydirname); $headlines =& $hlman->getObjects($criteria); $count = count($headlines); for ($i = 0; $i < $count; $i++) { $renderer =& xhld_getrenderer($headlines[$i],$mydirname); if (!$renderer->renderBlock( false , $maxlen )) { if( $xoopsConfig['debug_mode'] > 0 ) { $block['feeds'][] = sprintf(_HL_FAILGET, $headlines[$i]->getVar('headline_name')).'<br />'.$renderer->getErrors(); } continue; } $block['feeds'][] = $renderer->getBlock(); } $block['cols'] = $cols ; $block['td_attr'] = 'width="'.(100/$cols).'%" valign="top" id="xhld"' ; $block['mod_url'] = XOOPS_URL.'/modules/'.$mydirname ; return $block; } function b_xhld_edit( $options ) { $mydirname = empty( $options[0] ) ? basename( dirname( dirname( __FILE__ ) ) ) : $options[0] ; $mydirname4edit = htmlspecialchars( $mydirname , ENT_QUOTES ) ; $cols = empty( $options[1] ) ? 1 : intval( $options[1] ) ; $maxlen = empty( $options[2] ) ? 128 : intval( $options[2] ) ; $extraction = empty( $options[3] ) ? 'A' : $options[3] ; // make options for extraction $hlman =& xoops_getmodulehandler('headline', $mydirname); $headlines =& $hlman->getObjects(new Criteria('headline_asblock', 1)); $extraction_options = "<option value='A'>"._ALL."</option>\n<option value=''>----</option>\n" ; foreach( $headlines as $headline ) { $extraction_options .= "<option value='".sprintf( 'F%05d' , $headline->getVar('headline_id' ) )."'>".$headline->getVar('headline_name')."</option>\n" ; } $extraction_options = preg_replace( "/(value='$extraction')/" , "\$1 selected='selected'" , $extraction_options ) ; $ret = " <input type='hidden' name='options[0]' value='$mydirname4edit' /> "._MB_HEADLINES_COLS.":<input type='text' name='options[1]' value='$cols' size='2' /> <br /> "._MB_HEADLINES_MAXLEN.":<input type='text' name='options[2]' value='$maxlen' size='4' /> <br /> "._MB_HEADLINES_EXTRACT.": <select name='options[3]'> $extraction_options </select> \n"; return $ret ; } function b_xhld_mixed_show( $options ) { $mydirname = empty( $options[0] ) ? basename( dirname( dirname( __FILE__ ) ) ) : $options[0] ; $maxitem = empty( $options[1] ) ? 10 : intval( $options[1] ) ; $maxlen = empty( $options[2] ) ? 128 : intval( $options[2] ) ; $maxitemafeed = empty( $options[3] ) ? 99 : intval( $options[3] ) ; $block = array(); $hlman =& xoops_getmodulehandler('headline', $mydirname); $headlines =& $hlman->getObjects(new Criteria('headline_asblock', 1)); $count = count($headlines); $items = array() ; for ($i = 0; $i < $count; $i++) { // list( $usec , $sec ) = explode( " " , microtime() ) ; // $starttime = $sec + $usec ; $renderer =& xhld_getrenderer($headlines[$i],$mydirname); $itemsperfeed = empty( $renderer->config["mixed_mode"] ) ? 100 : $headlines[$i]->getVar('headline_blockmax') ; $tmp_data = $renderer->getRawDataAsArray( false , min( $itemsperfeed , $maxitemafeed ) , $maxlen ) ; $dtfmt_short = empty( $renderer->config["dtfmt_short"] ) ? '' : $renderer->config["dtfmt_short"] ; // list( $usec , $sec ) = explode( " " , microtime() ) ; // echo "<p>" . ( $sec + $usec - $starttime ) . "sec.</p>" ; if( ! empty( $tmp_data ) ) { $no_pubdate_counter = $i ; foreach( $tmp_data['items'] as $item ) { if( empty( $item['pubdate'] ) ) { $item['pubdate'] = '' ; $no_pubdate_counter += $count ; $sort_weight = - $no_pubdate_counter ; } else { $sort_weight = $item['pubdate'] ; } $items[] = array( 'site_name' => $tmp_data['site_name'] , 'site_url' => $tmp_data['site_url'] , 'site_id' => $tmp_data['site_id'] , 'channel_data' => $tmp_data['channel_data'] , 'image_data' => empty( $tmp_data['image_data'] ) ? array() : $tmp_data['image_data'] , 'title' => $item['title'] , 'link' => $item['link'] , 'sort_weight' => $sort_weight , 'pubdate' => $item['pubdate'] , 'pubdate_utz' => xoops_getUserTimestamp( $item['pubdate'] ) , 'date_short' => date( $dtfmt_short , xoops_getUserTimestamp( $item['pubdate'] ) ) , 'date' => formatTimestamp( $item['pubdate'] , 'm' ) , 'description' => empty( $item['description'] ) ? '' : $item['description'] ) ; } } } // order by pubdate desc usort( $items , create_function( '$a,$b' , 'return $a["sort_weight"] < $b["sort_weight"] ? 1 : -1 ;' ) ) ; $block['maxitem'] = $maxitem ; $block['items'] = $items ; $block['mod_url'] = XOOPS_URL.'/modules/'.$mydirname ; $block['dtfmt_short'] = empty( $dtfmt_short ) ? '' : $dtfmt_short ; return $block ; } function b_xhld_mixed_edit( $options ) { $mydirname = empty( $options[0] ) ? basename( dirname( dirname( __FILE__ ) ) ) : $options[0] ; $mydirname4edit = htmlspecialchars( $mydirname , ENT_QUOTES ) ; $maxitem = empty( $options[1] ) ? 10 : intval( $options[1] ) ; $maxlen = empty( $options[2] ) ? 128 : intval( $options[2] ) ; $maxitemafeed = empty( $options[3] ) ? 99 : intval( $options[3] ) ; $ret = " <input type='hidden' name='options[0]' value='$mydirname4edit' /> "._MB_HEADLINES_MAXITEM_MIXED.":<input type='text' name='options[1]' value='$maxitem' size='3' /> <br /> "._MB_HEADLINES_MAXLEN.":<input type='text' name='options[2]' value='$maxlen' size='4' /> <br /> "._MB_HEADLINES_MAXITEMAFEED_MIXED.":<input type='text' name='options[3]' value='$maxitemafeed' size='4' />\n" ; return $ret ; } } ?>




Ric




TopTop
« 1 2 3 (4) 5 6 7 ... 19 »



Login

Who's Online

189 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 189


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits