Posted on: 10/13/04 01:05am
By: Anonymous (CosmicInsight)
Hi... I'm new at this so please bear with me. What I did was I removed the "what's related" block from the article page and created a custom block based on how the story options block was created. It works, but because I used the COM_makeList() fuction it shows a little bullet on the left side. Is there another function I can use so that it doesn't show the bullet?
Thanks!
Custom Block in article page
Posted on: 10/13/04 03:43am
By: Anonymous (ironmax)
You are most likely looking for something like this, and just replace the href links with your own inside the normal block setting.
Spam
Hacking
Reporting network
abuse
RIR Networks
Our Spam Control Policy[*1]
Mail
Blocks[*2]
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="200">
<tr>
<td><a href="/staticpages/index.php?page=20040801005027880">Spam</a>
<br><a href="/staticpages/index.php?page=20040801015311973">Hacking</a>
<br><a href="/staticpages/index.php?page=20040801013954950">Reporting network
abuse</a>
<br><a href="/staticpages/index.php?page=20040801031624549">RIR Networks</a>
<br><a href="http://www.spacequad.com/staticpages/index.php?page=20040810012647519">Our Spam Control Policy</a>
<br><a href="http://www.spacequad.com/staticpages/index.php?page=20040810013405532">Mail
Blocks</a>
</td>
</tr>
</table>
</div>
Custom Block in article page
Posted on: 10/13/04 04:54am
By: Anonymous (cosmicInsight)
no that's not really what I'm looking for...
ok... when you click on the "read more" link to see the full article, the right blocks are missing except for a "what's related" block and "story options" block. What I did was remove the what's related block and added a custom block in it's place. So I edited the article.php and article.thtml files and created my block based on how the "story options" block was created in article.php. It worked but there's a little bullet on left side of the block because I believe the COM_makeList() fuction put's it there. I wanna know how to remove that bullet.
Anyone else got any solutions?
Thanks!
Custom Block in article page
Posted on: 10/13/04 01:46pm
By: Dirk
[QUOTE BY= cosmicInsight] So I edited the article.php and article.thtml files and created my block based on how the "story options" block was created in article.php.[/QUOTE]
Sounds like the problem is in your code then ...
bye, Dirk
Custom Block in article page
Posted on: 10/13/04 02:29pm
By: Anonymous (cosmicInsight)
[QUOTE BY= Dirk] [QUOTE BY= cosmicInsight] So I edited the article.php and article.thtml files and created my block based on how the "story options" block was created in article.php.[/QUOTE]
Sounds like the problem is in your code then ...
bye, Dirk[/QUOTE]
Ok here's my code in article.php....
//adsense related code ... making array and then putting code in array.
// probably a better way to do this....
$adsense_code = array ();
$adsense_code[] = '<script type="text/javascript"><!--
google_ad_client = "pub-9403829711976375";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel ="";
google_color_border = "2D5893";
google_color_bg = "99AACC";
google_color_link = "000000";
google_color_url = "000099";
google_color_text = "003366";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
// related adsense code... makes the block
if (count ($story_options) > 0) {
$adsenseblock = COM_startBlock ($Lang11[5], '',
COM_getBlockTemplate('story_options_block', 'header'
)
. COM_makeList ($adsense_code)
. COM_endBlock (COM_getBlockTemplate ('story_options_block',
'footer'
);
}
$story_template->set_var ('adsense', $adsenseblock);
and then I just call {adsense} in article.thtml
Custom Block in article page
Posted on: 10/13/04 02:37pm
By: Dirk
Why are you even using COM_makeList? As the name suggests, this function creates a list, using the list.thtml and listitem.thtml template files.
Simply remove that function call ...
bye, Dirk
Custom Block in article page
Posted on: 10/13/04 02:57pm
By: Anonymous (cosmicInsight)
[QUOTE BY= Dirk] Why are you even using COM_makeList? As the name suggests, this function creates a list, using the list.thtml and listitem.thtml template files.
Simply remove that function call ...
bye, Dirk[/QUOTE]
Ok I figured it out... thanks Dirk.
Custom Block in article page
Posted on: 12/21/04 08:33am
By: Anonymous (Goat)
Hi,
I too wanted to add an Adsense block to my site (
www.worldfootynews.com[*3] ). I successfully added it to my front page by adding a right block (advertisements) and just pasting in the html supplied by Google. But I also want it to appear on articles. I was following the technique listed here (is it the best way?) and it seemed to make sense (given I know bugger-all about php etc), but my stories just come up with a block title bar and the word "array" but no ads or anything. Any thoughts? It seems to be taking $adsense_code literally as the string array, even though I define it as suggested and fill it.
I followed as above, even cutting and pasting, except of course using my Google ad text and removing the COM_makelist call. So the 2 modified files are article.php and in article.thtml in the default theme apv_aeon I just added {adsense}.
When removing COM_makelist, what should I replace it with? I tried nothing and got nothing. I tried . $adsense_code and just got the word array. I think I'm close.
Or would it be better to use this thread:
http://www.geeklog.net/forum/viewtopic.php?forum=3&showtopic=38358[*4]
because surely I can just call advertsiments from article.php and get the block that works on the front page? I'd try this method but I'm halfway though method 1 and don't want to stuff it up, and I reckon I'm a bit light on on info to do this 2nd method anyway.
Help!?
Custom Block in article page
Posted on: 12/28/04 07:25pm
By: Anonymous (Goat)
Can anyone help me? I suspect I'm only a line away from success but have no idea what that line is.
Custom Block in article page
Posted on: 01/11/05 09:29am
By: Anonymous (Goat)
OK, I'll stop bugging people after this last cry for help.... Dirk, somebody, anybody?
Custom Block in article page
Posted on: 01/11/05 12:40pm
By: machinari
[QUOTE BY= cosmicInsight] I wanna know how to remove that bullet. [/QUOTE]re the bullet issue. try
this[*5]
Custom Block in article page
Posted on: 01/12/05 12:40am
By: Anonymous (Goat)
Thanks machinari! So sounds like you are recommending I stick to using makelist and just get rid of the bullets and indents as per that other thread. OK, I've tried that and it works, my ads (javascript) appear, although it has the drawback that I'm only up to GL 3.9 not 3.10 so I don't think I can set it just for a given class (wouldn't know how to anyway) so all my lists lose their bullets, which probably isn't great. If no other suggestions are forthcoming I might just have to live with a bullet next to my ads - still an improvement.
For interest, my code before switching to using makelist was (except I've blocked out my client id):
article.php:
$adsense_code = array ();
$adsense_code[] = '<script type="text/javascript"><!--
google_ad_client = "pub-****************";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel ="";
google_color_border = "666666";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';
// related adsense code... makes the block
{
$adsenseblock = COM_startBlock ($LANG11[5], '',
COM_getBlockTemplate('story_options_block', 'header'
)
// . COM_makelist ($adsense_code)
. $adsense_code
. COM_endBlock (COM_getBlockTemplate ('story_options_block',
'footer'
);
}
$story_template->set_var ('whats_related', $related);
$story_template->set_var ('story_options', $optionsblock);
$story_template->set_var ('whats_related_story_options',
$related . $optionsblock);
$story_template->set_var ('adsense', $adsenseblock);
and in article.thtml call it with:
{whats_related_story_options}{adsense}
and instead of ads I just got the word "Array". It would seem from reading at www.php.net and www.w3schools.com that I'm creating the array $adsense_code correctly, but my $adsenseblock isn't translating the javascript. Maybe I need to use echo to create the javascript? I'm way out of my depth. I've spent many hours trying to read up on the area, but can't really afford any more time as well as trying to maintain the website and write articles for it (all as a "hobby"
.
Custom Block in article page
Posted on: 01/12/05 01:18am
By: machinari
I know squat about javascript so cant help you there. and I am not suggesting you use or do not use makelist. just letting you know what I do in some cases. hope this helps.
[QUOTE BY= Goat]I'm only up to GL 3.9 not 3.10 so I don't think I can set it just for a given class (wouldn't know how to anyway) so all my lists lose their bullets, which probably isn't great.[/QUOTE]
1.3.9 list.thtml looks like this:
<!-- <ul> -->
{list_items}
<!-- </ul> -->
change it to this:
<ul class="nobuttons">
{list_items}
</ul>
now use the CSS
UL.nobuttons {
list-style-position: inside;
}
UL.nobuttons LI {
list-style: none;
}
or something along those lines...
Custom Block in article page
Posted on: 01/26/05 10:19am
By: Anonymous (Goat)
Thanks for the help. I implemented some of it, but I reckon I'll leave the rest until after we've upgraded to the latest version of GL (which will be ASAP).
Cheers!
Custom Block in article page
Posted on: 07/10/05 01:35am
By: MrHyde
I've tried the code above posted by Goat and it works ok, except for two things.
- the bullet point before the ads. I can live with that.
- The title of the block being "PDF Story Format". How/where do I change that to something else?