Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Slashes in Article Snippets

Asked Modified Viewed 2,792 times
M
Moishe
M
Moishe 10
It seems the more I learn, the more I don't know!
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions
asked
Junior Member

Is anyone else seeing this problem? When I post an article that contains quotes the slashes preceeding the quotes shows up in the "snippet" but not in the article itself. Is this a bug? Is there a simple fix?

Here is a link where this problem can be viewed (I have edited other snippets in PhpMyAdmin to remove these but would rather not do this):

http://www.noachidechassid.com/news.php
Edited by Moishe on 21-01-2006 20:23,
0 replies

6 posts

F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Can you paste the code from articles.php?
0 replies
M
Moishe
M
Moishe 10
It seems the more I learn, the more I don't know!
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions
answered
Junior Member

<?php
/*--------------------------------------------+
| PHPFusion 5 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: nick@php-fusion.co.uk |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."articles.php";

if (!isset($cat_id)) {
opentable($locale['400']);
$result = dbquery("SELECT * FROM ".$db_prefix."article_cats WHERE ".groupaccess('article_cat_access'wink." ORDER BY article_cat_name"wink;
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 2;
echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl'>\n<tr>\n";
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) echo "</tr>\n<tr>\n";
$num = dbcount("(article_cat)", "articles", "article_cat='".$data['article_cat_id']."'"wink;
echo "<td align='center' valign='top' width='50%'><a href='".FUSION_SELF."?cat_id=".$data['article_cat_id']."'>".$data['article_cat_name']."</a> <span class='small2'>($num)</span>";
if ($data['article_cat_description'] != ""wink echo "<br>\n<span class='small'>".$data['article_cat_description']."</span>";
echo "</td>\n";
$counter++;
}
echo "</tr>\n</table>\n";
} else {
echo "<center><br>\n".$locale['401']."<br><br>\n</center>\n";
}
closetable();
} else {
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."article_cats WHERE article_cat_id='$cat_id'"wink;
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['article_cat_access'])) {
$res = 1;
opentable($locale['400'].": ".$cdata['article_cat_name']);
$rows = dbcount("(article_id)", "articles", "article_cat='$cat_id'"wink;
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."articles WHERE article_cat='$cat_id' ORDER BY ".$cdata['article_cat_sorting']." LIMIT $rowstart,15"wink;
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['article_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span class='small'>[".$locale['402']."]</span>";
} else {
$new = "";
}
echo "<a href='readarticle.php?article_id=".$data['article_id']."'>".$data['article_subject']."</a>$new<br>\n".stripslashes($data['article_snippet']);
echo ($i != $numrows ? "<br><br>\n" : "\n"wink; $i++;
}
closetable();
if ($rows > 15) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,15,$rows,3,FUSION_SELF."?cat_id=$cat_id&"wink."\n</div>\n";
} else {
echo "<center>".$locale['403']."</center>\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}

require_once "side_right.php";
require_once "footer.php";
?>
Edited by Moishe on 22-01-2006 01:39,
0 replies
M
Moishe
M
Moishe 10
It seems the more I learn, the more I don't know!
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions
answered
Junior Member

I just noticed something I had not seen before. At the top of the articles.php it says "| PHPFusion 5 - Content Management System |
" and yet I have 6.00.303 installed. Is this, perhaps, the wrong articles.php? It is the one that came with the installation package.

Also, the slashes show up on the front page in the "Most Recent Articles" panel, not in the articles themselves. Could it be a bug in the Infusion?

Thanks!
Edited by Moishe on 22-01-2006 18:02,
0 replies
M
Moishe
M
Moishe 10
It seems the more I learn, the more I don't know!
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions
answered
Junior Member

Quote

<?
/*--------------------------------------------+
| PHPFusion 5 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: nick@php-fusion.co.uk |
|---------------------------------------------|
| infusion by: Rayxen © 2004-2005 |
| web: http://www.phpfusion-mods.com |
| email: rayxen@phpfusion-mods.com |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/

//-------------- Configuration --------------//
$shading = true; // Enable row shading (true/false)
$num_articles = 5; // How many articles to display

if (file_exists(INFUSIONS."articles_list_panel/locale/".$settings['locale'].".php"wink) {
include INFUSIONS."articles_list_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."articles_list_panel/locale/English.php";
}

function display_articles($article,$category,$a_author) {
$display_article = "<tr>\n<td align='left' class='tbl2'><a href='".BASEDIR."readarticle.php?article_id=".$article['article_id']."'>".$article['article_subject']."</a></td>
<td class='tbl2'><a href='".BASEDIR."articles.php?cat_id=".$article['article_cat']."'>".$category."</a></td>
<td align='left' class='tbl2'><a href='".BASEDIR."profile.php?lookup=".$article['article_name']."'>".$a_author."</td>
<td align='center' class='tbl2'>".$article['article_reads']."</td>
<td align='right' class='tbl2'>".$article['article_datestamp']."</td>\n</tr>\n
<tr><td colspan='5' class='tbl1'><span class='small'>".$article['article_snippet']."</span></td></tr>";
return $display_article;
}

opentable($locale['ALP_001']);

$most_recent_articles = dbquery("SELECT * FROM ".$db_prefix."articles ORDER BY article_id DESC"wink;

echo "<table width='100%' cellpadding='0' cellspacing='0' style='text-indent:2px'>\n<tr>\n";

if (dbrows($most_recent_articles)) {

// Display headings
echo "
<td class='tbl1' align='left'><b>".$locale['ALP_002']."</b></td>
<td class='tbl1'><b>".$locale['ALP_003']."</b></td>
<td class='tbl1' align='left'><b>".$locale['ALP_004']."</b></td>
<td class='tbl1' align='center'><b>".$locale['ALP_005']."</b></td>
<td class='tbl1' align='right'><b>".$locale['ALP_006']."</b></td>
</tr>";

// Only display articles that exist
while($article = dbarray($most_recent_articles)) {

if ( $x <= $num_articles ) {
// Calculate date submitted
$article['article_datestamp'] = showdate("forumdate",$article['article_datestamp']);

// Look up Category
$result = dbquery("SELECT article_cat_name FROM ".$db_prefix."article_cats WHERE article_cat_id='".$article['article_cat']."'"wink;
$category = dbresult($result,0);

// Look up Author
$result = dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id='".$article['article_name']."'"wink;
$a_author = dbresult($result,0);

// Display articles
echo display_articles($article,$category,$a_author);
$x++;
}
}
} else {
echo "<tr><td colspan='5' align='center'><p>".$locale['ALP_007']."</p></td></tr>";
}

echo "</table>";

closetable();
tablebreak();
?>
0 replies
M
Moishe
M
Moishe 10
It seems the more I learn, the more I don't know!
  • Junior Member, joined since
  • Contributed 22 posts on the community forums.
  • Started 6 threads in the forums
  • Started this discussions
answered
Junior Member

Ok, I think I fixed the bug. :/

I changed line 33 to read:

Quote

<tr><td colspan='5' class='tbl1'><span class='small'>".stripslashes($article['article_snippet'])."</span></td></tr>";

0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Yes that's the correct fix.
0 replies

Category Forum

Bugs and Errors - 6

Labels

None yet

Statistics

  • Views 0 views
  • Posts 6 posts
  • Votes 0 votes
  • Topic users 2 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet