TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 413
  • Total: 413

Re: "recent topics" in SMF style [Include Boards]

Started by insanemustang, January 07, 2009, 08:38:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zetan

#30
try adding an apostrophe & semicolon at the end ';




echo '<a href="' . $my['href'] . '">';



You might not need the apostrophe '

JPDeni

There was not a semi-colon in the original, which is why I didn't put it into the replacement code.

You'll need to post the whole section in order to see where the problem is.


insanemustang

Quote from: JPDeni on March 15, 2009, 04:50:30 PM
You'll need to post the whole section in order to see where the problem is.

I'm assuming you mean the part that's displayed?  Here is the code.


// Print out the results
  echo '<blockquote><img src="http://www.bamanation.net/images/websitenews.png"></blockquote>';
   echo '<span class="smalltext">';
foreach($result as $my){
  echo "$bullet";
  echo '<span class="normaltext">'.$my['link'],' ';
  echo '(', '<span class="smalltext">'.$my['topic']['replies'],') ';
  // is this topic new? (assume they are logged in)
  if (!$my['new'] && $context['user']['is_logged'])
   echo '<a href="', $scripturl, '?topic=', $my['topic'], '.from', $my['newtime'], '#new">
    <img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
  echo '</span>';
  echo '<span class="largetext">','<br>';
}


Thanks for all the help.  I have no doubt that this will be solved soon.

JPDeni


// Print out the results
  echo '<blockquote><img src="http://www.bamanation.net/images/websitenews.png"></blockquote>';
   echo '<span class="smalltext">';
foreach($result as $my){
  echo "$bullet";
  echo '<span class="normaltext">'.$my['link'],' ';
  echo '(', '<span class="smalltext">'.$my['topic']['replies'],') ';
  // is this topic new? (assume they are logged in)
  if (!$my['new'] && $context['user']['is_logged'])
  echo '<a href="' . $my['href'] . '">
    <img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
  echo '</span>';
  echo '<span class="largetext">','<br>';
}


I got no syntax errors in that code.

insanemustang

i know, but the new image doesn't take you anywhere...

JPDeni

#36
I thought the problem we were dealing with at the moment was the syntax error. That's the last error you posted.

What is the link that it gives?

ETA: I just realized what's going on.

I gave you a line of code. You pasted that line into your code incorrectly and got a syntax error.

You pasted a bit of the original code (withouth the revised line) into a post. I copied that code *and made the change of the one line that I had made before* into your bit of code. I posted *the altered code* into a post.

You thought that I just checked your original code, and, without trying the code that I posted, said it didn't take you anywhere. I was thinking that you meant that the new code I gave you didn't take you anywhere. Then I thought about it a bit and realized that you didn't try the new code at all.

Paste the most recent code I posted into your block and see what happens. If you have a syntax error, it will be in some other place in your code. If you still have problems with the link, post what the link actually says so that I will know where to look for the problem.

insanemustang

Strange... I posted exactly what you gave me back into a block so I could give you the syntax error, and the entire code... and it worked perfectly.

I don't know what happened, but I am extremely sorry I wasted your time for a day on this.

Thank you so much for your help.

JPDeni

That's okay. It happens. :)

I'm glad it worked for you. All's well that ends well!

This website is proudly hosted on Crocweb Cloud Website Hosting.