Dynamic Related News

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Postby bozoka45 » Fri Sep 16, 2005 5:20 pm

You are looking at the page before it's process by the server, right?


You need to be a little more helpful here, as everything should be working. Did you enter all the settings into dynamic news correctly?
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby web » Fri Sep 16, 2005 5:31 pm

Code: Select all
<table width="100%" border="0">
          <tr valign="top">
            <td colspan="4" background="http://localhost/images/cat_back.gif"> <h6><Field: Subject></h6></td>
          </tr>
         
          <tr bgcolor="#e9e9e9">
            <td width="10%" valign="top" class="item" >Дата:<br>
                         Время:
    <If: Field: CustomField_Author>
 <br>Автор:
 </If>
<If: Field: CustomField_AuthorDef>
<br> Об авторе:
</If>

<br> Источник:
</td>
            <td colspan="3" valign="top" class="item"><Field: TwoDigitDay>/<Field: TwoDigitMonth>/<Field: Year><br><Field: TwoDigitHour>:<Field: Minute>

<If: Field: CustomField_Author>
 <br><Field: CustomField_Author>
</If>
<If: Field: CustomField_AuthorDef>
<br><Field: CustomField_AuthorDef>
</If>
<If: Field: CustomField_Source>
<br><a class="news" href="http://<Field: CustomField_URL>">
<Field: CustomField_Source></a>
<If: Else><br><a class="news" href="http://apsny.ge">apsny.ge</a>
</If>

</td>
          </tr>
          <tr bgcolor="#e9e9e9">
            <td colspan="2" class="news">

 <a class="small" href="mailto:?subject=<Field: Subject>">Отправить  другу</a>



</td>




            <td width="36%">
              <div align="center" class="news">

<PerlCode>
if ($phpBB_threadid){
$newshtml .= qq~<a href="../forum/viewtopic.php?t=$phpBB_threadid">Обсудить на форуме ($phpBBComments_ReplyCount{$phpBB_threadid})</a><br>~;
}
</PerlCode>


</div></td>


 

            <td width="35%" class="news"><div align="right">
<a class="small" href="http://localhost/cgi-bin/news/viewnews.cgi?id=<Field: newsid>&style=print&tmpl=print" target="_new"> Версия для печати</a>

</div>
</td></tr>
          <tr>
            <td colspan="4">


<span class="news">
<If: Field: PrevSplit>
   <br><div align="left">(<a class="small" href="<Field: PrevSplit>">&laquo;&laquo;См. Начало</a>)</div>   
</If> </span>


<If: Field: CustomField_Upload>
<img src="<FilePath: CustomField_Upload>" alt="<Field: CustomField_alt>"  align="left">
       
</If>

<div class="text" align="justify"><Field: SplitText></div>
<span class="news">
<If: Field: NextSplit>
   <div align="right"> (<a class="small" href="<Field: NextSplit>">Продолжение &raquo;&raquo;</a>)</div>
   </If></span><br><br>

<div align="center" class="news">Страницы: <Field: pageTOC></div>

</td>
          </tr>
          <tr>
            <td colspan="4"  height="10"></td>
          </tr>
          <tr bgcolor="#e9e9e9">
            <td colspan="2" class="news">

 <a class="small" href="mailto:?subject=<Field: Subject>">Отправить другу</a>



</td>




            <td width="36%">
              <div align="center" class="news"><PerlCode>
if ($phpBB_threadid){
$newshtml .= qq~<a href="../forum/viewtopic.php?t=$phpBB_threadid">Обсудить на форуме ($phpBBComments_ReplyCount{$phpBB_threadid})</a><br>~;
}
</PerlCode>


</div>

</td>
 

            <td width="35%" class="news"><div align="right"> <span class="news"><a class="small" href="../cgi-bin/news/viewnews.cgi?id=<Field: newsid>&style=print&tmpl=print" target="_new"> Версия для печати</a>
</div></td></tr>       </table>

<?php
$search = "<Field: Subject>";
$search = urlencode($search);
include ( 'http://localhost/related.php?s=' . $search);
?>


This is style i'm using.

related.php done by copy-paste of your code (changed only db related info)

tmpl uses only <Field: content>
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby bozoka45 » Sat Sep 17, 2005 9:07 am

Well, it's more advisable to add this to your template rather than your style because than it will only display once. However, I don't need to see your style, as that appears to be ok. I'd rather see the files that are produced by Coranto, before they are processed by the server.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby web » Sat Sep 17, 2005 3:37 pm

Ok.

in the file processed by coranto and in the place where related news must appear i have such code

Code: Select all
<?php
$search = "Недальновидность или нервозность?";
$search = urlencode($search);
include ( 'http://localhost/related.php?s=' . $search);
?>


processed only <Field: Subject> but nothing searched and printed


where
"Недальновидность или нервозность?"; - it's a subject as i have included in style (in russian)

I've tried


Code: Select all
include ( '../related.php?s=' . $search);


tryed

Code: Select all
.......related.php?s='.$search);


tryed to include this code in tmpl instead of style,

what happens is that i'm getting the code i've included with processed only
Subject field.
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby bozoka45 » Sat Sep 17, 2005 6:12 pm

Ok, you won't get related news when you build news in Coranto. What Coranto is outputting is correct.

Change this:

Code: Select all
include ( 'http://localhost/related.php?s=' . $search);


To:

Code: Select all
include ( 'http://localhost/related.php?s=' . $search) or die("Can't include Related news");


And see if you get the "Can't include Related news" error.

Next question, do you have PHP installed and did you make sure the extension of the file that Coranto is outputting is "php"? You should be getting a notice saying there is no news, it doesn't just display blank.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby web » Sat Sep 17, 2005 6:20 pm

And see if you get the "Can't include Related news" error.


no. there is nothing

Next question, do you have PHP installed and did you make sure the extension of the file that Coranto is outputting is "php"?


it's ok with php and news displaing. Problems only with DRN
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby bozoka45 » Sun Sep 18, 2005 6:33 am

Try chaning the code in related.php:

Code: Select all
if($rcount > 0) {
   print $relatedHTML;
}


To:

Code: Select all
if($rcount > 0) {
   print $relatedHTML;
} else {
   print "No news to display";
}
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby web » Sun Sep 18, 2005 9:39 am

http://abkhaziainfo.f2o.org/tmpl.txtlook at my tmpl file in .txt format an http://abkhaziainfo.f2o.org/news_php.txt - Coranto generated source of news file

Code: Select all
if($rcount > 0) {
   print $relatedHTML;
} else {
   print "No news to display";
}


gives nothing too
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby bozoka45 » Sun Sep 18, 2005 9:45 am

Well it looks like it's in your style, so I'd need to see that, but one thing that's missing are the <?php ?> tags.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby web » Sun Sep 18, 2005 12:52 pm

I've deleted code from my style and tried with tmpl. Results are below


Code: Select all
include ( 'http://localhost/related.php') or die("Can't include Related news");


prints nothing

Code: Select all
http://localhost/related.php?s='.$search


prints nothing

Code: Select all
<?php include("http://loclahost/related.php");?>


prints - No news to display
this one was included standalone
start point version
http://localhost/related.php?s=' . $search

in editors shows the link up to s='
. $search is out of link


I've entered one news 6 times. It shows nothing.


PHP tags? ok. Ihave changed that file with new generated one with php tags. result is the same
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby bozoka45 » Sun Sep 18, 2005 7:26 pm

this one was included standalone
start point version
http://localhost/related.php?s=' . $search

in editors shows the link up to s='
. $search is out of link


I honestly have no idea what that means. Totally confused.

Anyway, the reason the first two aren't working are because THERE ARE NO PHP TAGS AROUND THEM, therefore, your server doesn't know to process them as PHP and you are getting expected results. The reason you're getting "No news to display" with your third method is because there is no search string. You need to use:

Code: Select all
<?php
$search = "<Field: Subject>";
$search = urlencode($search);
include ( 'http://localhost/related.php?s=' . $search);
?>


I'm sorry if it's not working for you..but that's what needs to be in your template, word for word. Copy and paste.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby web » Mon Sep 19, 2005 1:11 pm

yes. tsgs were misiing. but i've chenged it as you provided.
Untagged version was provided because of my experiment to enter php tags to the start and end of whole document.
So I've put the wrong version. Sorry for that

Code: Select all
<?php
$search = "<Field: Subject>";
$search = urlencode($search);
include ( 'http://localhost/related.php?s=' . $search);
?>


this is what i am trying but it does not work


Code: Select all
http://abkhaziainfo.f2o.org/news_php.txt
this is what i have in news with php tags
http://localhost/related.php?s=' . $search
is not there mistake because the link is only http://localhost/related.php?s='
I don't know php so maybe I'd not ask this question.

The problem is that the code above you gave doesn't work. that's what i'm trying to make work
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby bozoka45 » Mon Sep 19, 2005 5:19 pm

The code does work. Trust me, I'm using it on my site. As I've said before, you need to make sure the code has a .php extension and your server has php. I won't answer another question until you say "Yes, the file has a .php extension and php is installed on my server." You ignored that question before.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby web » Mon Sep 19, 2005 6:19 pm

Yes, the file has a .php extension and php is installed on my server


I'm using phpBB forum and it works fine. i'm using SiteSearchPro and it works fine. I'm sure yor script works fine for you. But it wantn't work for me :-)) I'm doing all as you are speaking. DRN is only addon left to install my site

Maybe the problem is in style or in use of Fields in your style that i haven't (CustomField_surl)? I don't know.
User avatar
web
 
Posts: 176
Joined: Sun Nov 30, 2003 3:39 pm

Postby bozoka45 » Tue Sep 20, 2005 4:56 am

I'm sorry but I really don't understand what's wrong. You should style it as you want, but that's not your problem. This isn't an addon, it's just a Customized script (hence why it's in the "Customized" section). I'm sorry I can't be of more help.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

PreviousNext

Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests

cron