1 papzadsl Jul 02, 2006 11:57
3 papzadsl Jul 03, 2006 09:12
So, with this piece of code:
<?php
require(dirname(__FILE__).'/evocore/_main.inc.php');
// Get the lastest posts
$ItemList = & new ItemList( 1 );
echo '<ul>';
while( $Item = $ItemList->get_item() )
{
?>
<li lang="<?php $Item->lang() ?>">
<?php $Item->issue_date() ?>:
<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a>
<span class="small">[<?php $Item->lang() ?>]</span>
</li>
<?php
}
?>
</ul>
I can recall last posts.
So, I can install b2evo into a subdir (like bloggersforequity.org/b2evo), and then recall its posts into the desired page (like bloggersforequity.org/ultime_notizie.php) by putting in it that code?
4 yabba Jul 03, 2006 18:49
Hi Françesco,
Sorry I was wandering around in a field.
You need to change 2 lines (and add a 3rd if you want the content to be displayed) :-
<?php
require(dirname(__FILE__).'/b2evo/evocore/_main.inc.php');
$ItemList = & new ItemList( 1, '', '', '', '', '', '', '', 'DESC');
echo '<ul>';
while( $Item = $ItemList->get_item() )
{
?>
<li lang="<?php $Item->lang() ?>">
<?php $Item->issue_date() ?>:
<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a>
<span class="small">[<?php $Item->lang() ?>]</span>
<?php $Item->content(); ?>
</li>
<?php
}
?>
</ul>
change the "1" to be the blogID of your news blog
You might also want to consider using a blog for the faq as well ;)
¥
5 papzadsl Jul 08, 2006 10:24
Uhm, since I experienced some problems with b2evo installation on that website (is it possible to install it on windows hosting?), and I have no time to try and fix it, I thought I can solve the issue if I can show in that page a post published on the other website, running b2evo: my sweety, silenzi.com.
I may publish the post I'd like to show in bloggersforequity.org in a blog I won't show on silenzi.com; so I won't have to do another installation...
Is it possible?
6 yabba Jul 08, 2006 10:48
Ok, it is possible to install b2evo on a windoze box (mine runs on one) as long as it has php and mysql installed.
What were your installation problems?
You can "page scrape" the post from one server to another.
¥
7 papzadsl Jul 08, 2006 10:57
As stated abouve, I currently don't have the time to investigate on what my space has and what hasn't :D
So, I go with "post stealing" from my silenzi.com: what have I to do to make it work?
I think we have to start from the above piece of code, but we have to tell to the system that he has to take that code from another server... am I right? I'm afraid I'm not :D
8 yabba Jul 08, 2006 11:14
It all depends on what languages (if any) are available on the windoze box ;)
¥
9 papzadsl Jul 08, 2006 11:27
Uhm... how/where do I watch to know these things?
10 yabba Jul 08, 2006 11:57
Save this as test.php :-
<?php
echo 'hello world';
?>
Save this as test.asp :-
<%
response.write( "hello world" )
%>
Save this as test.aspx :-
<%@ Page Language="VB"%>
<script runat="server">
sub Page_Load(o as Object, e as EventArgs)
response.write("hello world")
end sub
</script>
Upload all three files to the website and then call test.php, test.asp & test.aspx in your browser and see which of them work ;)
¥
11 papzadsl Jul 08, 2006 12:06
As my math teacher used to say "BOTH OF THREE work" :P
About php I had no doubt, since the website is developed on that language.
12 yabba Jul 08, 2006 12:18
lol, in that case we'll stick with php, save this as scrape.php and change the url to point to the real page on your server :-
<?php
$handle = fopen("http://www.silenzi.com/page_to_scrape.php", "r");
$contents = '';
if($handle)
{
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
}
echo $contents;
?>
Upload it to the website and include it in the page where you want the post(s) to appear.
Then save the code from waaaaaaaay up as "page_to_scrape.php" and upload it your website.
Hit go and hope it all works ;)
¥
13 papzadsl Jul 08, 2006 13:07
Uhm, so I have to save that piece of code BOTH in a file called scrape.php (and upload it on bloggersforequity.org) AND include in the page where I want to display silenzi.com's posts (ultime_notizie.php, on bloggersforequity.org)?
14 yabba Jul 08, 2006 13:19
ok, you save the code in my previous post as scrape.php and upload it to bloggersforequity [change the name of "page_to_scrape.php" in the url it calls to any name you like]
Then you save the page from further up as "page_to_scrape.php" (or any name you like as long as it matches the one in the url you call in "scrape.php") and upload it to your blog (silenzi.com).
Then, in the page on bloggersforequity add the following line where you want the post(s) to appear :-
<?php
include dirname(__FILE__).'/scrape.php';
?>
¥
15 papzadsl Jul 08, 2006 16:05
Ehehehe, you [url=http://www.bloggersforequity.org/ultime_notizie.php]smartass[/url].
Two more things to make the system PERFECT:
- the possibility of adding a permalink that point to the real post within bloggersforequity.org (now it points to silenzi.com), and
- the possibility to show categories (one for each NGO's) on the side.
And: how can I remove that suckin' [it-IT] next to the topic?
16 yabba Jul 08, 2006 16:15
lol, sheeesh, give you an inch and you want a mile!!!
It should all be possible but I'm about to go wander round a field again so it'll take a tad before I post any possible solutions ;)
to remove the [it-IT] delete this line :-
<span class="small">[<?php $Item->lang() ?>]</span>
¥
17 papzadsl Jul 08, 2006 16:35
Ok man, give up your efforts; I found a way to install a brand new version of b2evo within bloggersforequity.org, so you won't have to crash your brain on this fuckin' thing :D
So now (I installed a Phoenix 1.6 alpha) I just have to embed posts within ultime_notizie.php page, without importing them from silenzi.com (which, I think, it would be a lot more simple).
Man, I go on adding beers, but you feel free to kick my ass when I bothered you over the limits :D
lol, sheeesh, give you an inch and you want a mile!!!
Nice, here in Italy we say "Ti do un dito, mi prendi un braccio" (="I give you a finger, you want an arm") :DD
18 balupton Jul 08, 2006 17:01
just joining in now.
is the problem you have b2evo running on two different urls, and they one is refferring to the other?
Or am i totally of touch here.
19 papzadsl Jul 08, 2006 17:05
No Balupton, there isn't error anymore :D
Now, we can switch topic on about "how to embed a Phoenix 1.6 alpha in [url=http://www.bloggersforequity.org/ultime_notizie.php]this page[/url]" :D
I did my best by installing a b2evo under bloggersforequity.org/b2evolution and puttin in the "ultime_notizie.php" page this piece of code:
<?php
require(dirname(__FILE__).'/b2evo/evocore/_main.inc.php');
$ItemList = & new ItemList( 1, '', '', '', '', '', '', '', 'DESC');
echo '<ul>';
while( $Item = $ItemList->get_item() )
{
?>
<li lang="$Item->lang() ?>">
<?php $Item->issue_date() ?>:
<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a>
<span class="small">[<?php $Item->lang() ?>]</span>
<?php $Item->content(); ?>
</li>
<?php
}
?>
</ul>
But the link problem still remains (it redirects to the "real" blog)...
Thanks for you interest!
Hi Françesco,
[url=http://forums.b2evolution.net/viewtopic.php?t=8162&highlight=]This post[/url] should get you started ;)
¥