Login     Sign up
Adding text to top of module pages - News Feed, Events, Photos etc
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

Id like to put text on the module pages for News Feed, Events, Photos etc

Ive tried to modify the .php files for each module by inserting paragraph statements such as <p>test statement</P> but this results in an error.

Proberbly something simple, but what am i missing?

Your have to forgive all my questions recently, but im learning HTML and PHP on the fly.

164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

Please dont tell me i have to write it in PHP. :)

164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

OK think i found my answer - will come back to this if i have problems

http://www.jcow.net/docs/?s=api

Looks like i have to use this sort of code
section_content(), section_close()
Print content to users.
Usage: section_content($content=''), section_close($title='')
Example:

section_content('Content in section One');
section_close('Title of section One');

section_content('Content in section Two');
section_content(',Another Content of section Two');
section_close('Title of section Two');

The above example will output:

Note: These two functions can only be used in Jcow Modules.
If you want to print content in template (themes/YOUR_THEME_FOLDER/page.tpl.php), you should use Echo directly.

164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

Yep that cracked it :)

However what if i want to put images or hyper links in that area?

What i want to do is put script at the top of the modules for project wonderful and/or a rotating banner so i can sell ad space for sponsorship to purchase the jcow upgrades.

164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

OK ive tried adding this code to the feed.php file but i get an error. Its project wonderful code for displaying adverts from sponsors. ANy ideas what im doing wrong

<!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 53250 -->
<script type="text/javascript">
<!--
var pw_d=document;
pw_d.projectwonderful_adbox_id = "53250";
pw_d.projectwonderful_adbox_type = "5";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<noscript><map name="admap53250" id="admap53250"><area href="http://www.projectwonderful.com/out_nojs.php?r=0&c=0&id=53250&type=5" shape="rect" coords="0,0,728,90" title="" alt="" target="_blank" /></map>
<table cellpadding="0" border="0" cellspacing="0" width="728" bgcolor="#ffffff"><tr><td><img src="http://www.projectwonderful.com/nojs.php?id=53250&type=5" width="728" height="90" usemap="#admap53250" border="0" alt="" /></td></tr><tr><td bgcolor="#ffffff" colspan="1"><center><a style="font-size:10px;color:#0000ff;text-decoration:none;line-height:1.2;font-weight:bold;font-family:Tahoma, verdana,arial,helvetica,sans-serif;text-transform: none;letter-spacing:normal;text-shadow:none;white-space:normal;word-spacing:normal;" href="http://www.projectwonderful.com/advertisehere.php?id=53250&type=5" target="_blank">Ads by Project Wonderful! Your ad here, right now: $0</a></center></td></tr></table>
</noscript>
<!-- End of Project Wonderful ad code. -->

I inserted it before this section at the beginig of the code

class feed{
function feed() {
global $content, $db, $apps, $client, $settings, $menuon;
$menuon = 'feed';
set_title(t('News feed'));
do_auth( explode('|',get_gvar('permission_feed')) );
}

function index($page = 0) {
    global $content, $db, $apps, $client, $settings;
    $offset = $page * 12;
    c(allstream($client['id'],12,$offset) );
}
164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

I end up with this error

Parse error: syntax error, unexpected '<' in /home/p1pr33s/public_html/dealtowntoolbar.com/dealsocial/modules/feed/feed.php on line 10

164 months ago
emjhie Bahrink (@emjhie)
Join date: Sep 27th 2010
Community posts: 91
View Profile
Send Message

demo please..

164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

What do you mean demo?

164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

OK almost sussed it - had to change all the symbols " to ' in the following text like so

echo"
<!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 53250 -->
<script type='text/javascript'>
<!--
var pw_d=document;
pw_d.projectwonderful_adbox_id = '53250';
pw_d.projectwonderful_adbox_type = '5';
//-->
</script>
<script type='text/javascript' src='[url]http://www.projectwonderful.com/ad_display.js'></script>[/url]
<noscript><map name='admap53250' id='admap53250'><area href='[url]http://www.projectwonderful.com/out_nojs.php?r=0&c=0&id=53250&type=5'[/url] shape='rect' coords='0,0,728,90' title='' alt='' target='_blank' /></map>
<table cellpadding='0' border='0' cellspacing='0' width='728' bgcolor='#ffffff'><tr><td><img src='[url]http://www.projectwonderful.com/nojs.php?id=53250&type=5'[/url] width='728' height='90' usemap='#admap53250' border='0' alt='' /></td></tr><tr><td bgcolor='#ffffff' colspan='1'><center><a style='font-size:10px;color:#0000ff;text-decoration:none;line-height:1.2;font-weight:bold;font-family:Tahoma, verdana,arial,helvetica,sans-serif;text-transform: none;letter-spacing:normal;text-shadow:none;white-space:normal;word-spacing:normal;' href='[url]http://www.projectwonderful.com/advertisehere.php?id=53250&type=5'[/url] target='_blank'>Ads by Project Wonderful! Your ad here, right now: $0</a></center></td></tr></table>
</noscript>
<!-- End of Project Wonderful ad code. -->
";

However now the code appears above the main header bar, rather than under the bar above the news feeds.

What im trying to do is have the code appear above the news feeds but under the menu bar.

164 months ago
Danny Vuong (@picco)
Join date: Oct 28th 2010
Community posts: 64
View Profile
Send Message

Hi,
can you show me the link or demo your website.

thanks

164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

[url]www.dealtowntoolbar.com/dealsocial/index.php?p=feed[/url]

Although ive disabled the code as its a live site.

What i want to do is have www.projectwonderful.com code appear between the menu and the social feed

164 months ago
Philip Rees (@piprees)
Join date: Dec 8th 2010
Community posts: 98
View Profile
Send Message

OK still having trouble with this, really cant figure out why the additional code is not working.

163 months ago
1 2 Next