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?

Readmore Problem

Asked Modified Viewed 6,361 times
S
Samuel
S
Samuel 10
  • Member, joined since
  • Contributed 55 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
asked
Member

I changed news.php to welcome.php. When i posted news, it displayed correctly. But when i clicked at Readmore link, the link would become http://localhost/files/news.php?readmore=1. How can i change it to http://localhost/files/welcome.php?readmore=1
0 replies

7 posts

T
Talocha
T
  • Member, joined since
  • Contributed 90 posts on the community forums.
  • Started 10 threads in the forums
answered
Member

must function properly
What code is in welcome.php?

tine guess that contain well basis
<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
echo " ";
require_once THEMES."templates/footer.php";
?>
0 replies
S
Samuel
S
Samuel 10
  • Member, joined since
  • Contributed 55 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
answered
Member

Here is welcome.php code
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: news.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";

// Predefined variables, do not edit these values
$i = 0;

// Number of news displayed
$items_per_page = $settings['newsperpage'];

add_to_title($locale['global_200'].$locale['global_061']);

if (!isset($_GET['readmore']) || !isnum($_GET['readmore'])) {
   $rows = dbcount(
      "(news_id)",
      DB_NEWS,
      groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
                              AND (news_end='0'||news_end>=".time().")
                              AND news_draft='0'"
   );
   if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
   if ($rows) {
      $result = dbquery(
         "SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status
         FROM ".DB_NEWS." tn
         LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
         LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
         WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
            AND (news_end='0'||news_end>=".time().") AND news_draft='0'
         GROUP BY news_id
         ORDER BY news_sticky DESC, news_datestamp DESC LIMIT ".$_GET['rowstart'].",".$items_per_page
      );
      $numrows = dbrows($result);
      while ($data = dbarray($result)) {
         $i++;
         $comments = dbcount("(comment_id)", DB_COMMENTS." WHERE comment_type='N' AND comment_hidden='0' AND comment_item_id='".$data['news_id']."'");
         $news_cat_image = "";
         $news_subject = "<a name='news_".$data['news_id']."' id='news_".$data['news_id']."'></a>".stripslashes($data['news_subject']);
         $news_cat_image = "<a href='".($settings['news_image_link'] == 0 ? "news_cats.php?cat_id=".$data['news_cat']
                                                            : FUSION_SELF."?readmore=".$data['news_id'] )."'>";
         if ($data['news_image_t2'] && $settings['news_image_frontpage'] == 0) {
            $news_cat_image .= "<img src='".IMAGES_N_T.$data['news_image_t2']."' alt='".$data['news_subject']."' class='news-category' /></a>";
         } elseif ($data['news_cat_image']) {
            $news_cat_image .= "<img src='".get_image("nc_".$data['news_cat_name'])."' alt='".$data['news_cat_name']."' class='news-category' /></a>";
         } else {
            $news_cat_image = "";
         }
         $news_news = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);

         $news_info = array(
            "news_id" => $data['news_id'],
            "user_id" => $data['user_id'],
            "user_name" => $data['user_name'],
            "user_status" => $data['user_status'],
            "news_date" => $data['news_datestamp'],
            "cat_id" => $data['news_cat'],
            "cat_name" => $data['news_cat_name'],
            "cat_image" => $news_cat_image,
            "news_subject" => $data['news_subject'],
            "news_ext" => $data['news_extended'] ? "y" : "n",
            "news_reads" => $data['news_reads'],
            "news_comments" => $comments,
            "news_allow_comments" => $data['news_allow_comments'],
            "news_sticky" => $data['news_sticky']
         );

         echo "<!--news_prepost_".$i."-->\n";
         render_news($news_subject, $news_news, $news_info);
      }
      echo "<!--sub_news_idx-->\n";
      if ($rows > $items_per_page) echo "<div align='center' style=';margin-top:5px;'>\n".makepagenav($_GET['rowstart'],$items_per_page,$rows,3)."\n</div>\n";
   } else {
      opentable($locale['global_077']);
      echo "<div style='text-align:center'><br />\n".$locale['global_078']."<br /><br />\n</div>\n";
      closetable();
   }
} else {
   $result = dbquery(
      "SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status FROM ".DB_NEWS." tn
      LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
      LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
      WHERE ".groupaccess('news_visibility')." AND news_id='".$_GET['readmore']."' AND news_draft='0'
      LIMIT 1"
   );
   if (dbrows($result)) {
      include INCLUDES."comments_include.php";
      include INCLUDES."ratings_include.php";
      $data = dbarray($result);
      if (!isset($_POST['post_comment']) && !isset($_POST['post_rating'])) {
         $result2 = dbquery("UPDATE ".DB_NEWS." SET news_reads=news_reads+1 WHERE news_id='".$_GET['readmore']."'");
         $data['news_reads']++;
      }
      $news_cat_image = "";
      $news_subject = $data['news_subject'];
      if ($data['news_image_t1'] && $settings['news_image_readmore'] == "0") {
         $img_size = @getimagesize(IMAGES_N.$data['news_image']);
         $news_cat_image = "<a href=\"javascript:;\" onclick=\"window.open('".IMAGES_N.$data['news_image']."','','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=".($img_size[0]+20).",height=".($img_size[1]+20)."')\"><img src='".IMAGES_N_T.$data['news_image_t1']."' alt='".$data['news_subject']."' class='news-category' /></a>";
      } elseif ($data['news_cat_image']) {
         $news_cat_image = "<a href='news_cats.php?cat_id=".$data['news_cat']."'><img src='".get_image("nc_".$data['news_cat_name'])."' alt='".$data['news_cat_name']."' class='news-category' /></a>";
      }
      $news_news = stripslashes($data['news_extended'] ? $data['news_extended'] : $data['news_news']);
      if ($data['news_breaks'] == "y") { $news_news = nl2br($news_news); }
      $news_info = array(
         "news_id" => $data['news_id'],
         "user_id" => $data['user_id'],
         "user_name" => $data['user_name'],
         "user_status" => $data['user_status'],
         "news_date" => $data['news_datestamp'],
         "cat_id" => $data['news_cat'],
         "cat_name" => $data['news_cat_name'],
         "cat_image" => $news_cat_image,
         "news_subject" => $data['news_subject'],
         "news_ext" => "n",
         "news_reads" => $data['news_reads'],
         "news_comments" => dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."' AND comment_hidden='0'"),
         "news_allow_comments" => $data['news_allow_comments'],
         "news_sticky" => $data['news_sticky']
      );
      add_to_title($locale['global_201'].$news_subject);
      echo "<!--news_pre_readmore-->";
      render_news($news_subject, $news_news, $news_info);
      echo "<!--news_sub_readmore-->";
      if ($data['news_allow_comments']) { showcomments("N", DB_NEWS, "news_id", $_GET['readmore'], FUSION_SELF."?readmore=".$_GET['readmore']); }
      if ($data['news_allow_ratings']) { showratings("N", $_GET['readmore'], FUSION_SELF."?readmore=".$_GET['readmore']); }
   } else {
      redirect(FUSION_SELF);
   }
}

require_once THEMES."templates/footer.php";
?>
Edited by PolarFox on 16-11-2012 08:12,
0 replies
T
Talocha
T
  • Member, joined since
  • Contributed 90 posts on the community forums.
  • Started 10 threads in the forums
answered
Member

depends on the theme that is used
welcome.php must be achieved by changing the news.php by changing welcome.php

well look at the themes in the theme.php - function render_news
in case you
news.php by changing welcome.php
Edited by Talocha on 15-11-2012 22:24,
0 replies
S
Samuel
S
Samuel 10
  • Member, joined since
  • Contributed 55 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
answered
Member

I already changed it, but nothing changed. I used Reflux theme. Here is the code:
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Theme: Reflux
| Filename: theme.php
| Author: Structor {modstruct.ro}
+--------------------------------------------------------+
| This program is

released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt

or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

require_once INCLUDES."theme_functions_include.php";

// Required

constant
define("THEME_BULLET", "");

// Set png images
set_image("up", THEME."images/up.png");
set_image("down", THEME."images/down.png");
set_image("left",

THEME."images/left.png");
set_image("right", THEME."images/right.png");

set_image("newthread", THEME."forum/newthread.png");
set_image("reply",

THEME."forum/reply.png");
set_image("forum_edit", THEME."forum/edit.png");
set_image("quote", THEME."forum/quote.png");
set_image("pm", THEME."forum/pm.png");
set_image("web", THEME."forum/web.png");
set_image("email", THEME."forum/email.png");
set_image("profile", THEME."forum/profile.png");

//set_image("folder",

THEME."forum/folder.png");
//set_image("folderhot", THEME."forum/folderhot.png");
//set_image("folderlock", THEME."forum/folderlock.png");
//set_image("foldernew",

THEME."forum/foldernew.png");
//set_image("stickythread", THEME."forum/stickythread.png");

function render_page($license = false) {
   global $settings, $main_style, $locale,

$mysql_queries_time;

   // Container Start
   echo "<div id='container' style='background:  #fff url(".THEME."/images/sky.jpg) no-repeat top left;'>\n";
   
   //

Header
   echo "<div style='height:162px;'>";
//   echo "<div><img src='".$settings['sitebanner']."' alt='' /></div>\n";   
   echo "<div id='header'><a

href='".BASEDIR."index.php'>".$settings['sitename']."</a></div>\n";
   echo "<div id='description'>".$settings['description']."</div>\n</div>\n";   
   
   // Top Nav
   

echo "<div id='top-nav'>".showsublinks("")."</div>\n";   
   // Search
   echo "<div id='search' style='   position: absolute;   top: 169px;right: 7px;float: right;

z-index: 99999;'>\n";
   echo "<form action='".BASEDIR."search.php' method='get'>\n";
   echo "<input type='text' class='search' name='stext' /> ";
   echo "<input

type='submit' class='button' name='search' value='Search' />";
   echo "</form>\n";
   echo "</div>\n";
   echo "<div class='clear'></div>\n";   
   
   //

Content
   echo "<div id='conent' style='padding:5px; background:  #fff url(".THEME."/images/main_bg.png) repeat-x top left;'>\n";
//   if (LEFT) { echo "<div id='side-left'></div>\n";

}
   echo "<div id='side-right'>".LEFT.RIGHT."</div>\n";
   echo "<div id='side-center' class='".$main_style."'>";
   echo "<div

class='upper'>".U_CENTER."</div>\n";
   echo "<div class='content'>".CONTENT."</div>\n";
   echo "<div class='lower'>".L_CENTER."</div>\n";
   echo

"</div>\n";
   echo "<div class='clear'></div>\n";
   echo "</div>\n";
      
   //Footer
   echo "<div id='footer' class='".$main_style."'>\n";
   echo "<div

id='copyright-site'>".stripslashes($settings['footer'])."</div>\n";
   if (!$license) { echo "<div id='copyright-fusion'>".showcopyright()." | <a href='http://www.modstruct.ro' title='A

theme by Structor' target='_blank'>Reflux</a></div>\n"; }
   echo "</div>\n";

   echo "<!-- ".showrendertime()." -->";
   
   // Container End
   echo "</div>\n";   
   if

((LEFT) || (RIGHT)) {
      echo "<script type='text/javascript'>jQuery('#side-center').css('width', '687px');jQuery('#side-right').css('margin-top', '-20px');</script>\n";
   }
   }

function

render_news($subject, $news, $info) {
   global $_GET; $image = "";
   
   $image = $info['cat_image'];
   
   echo "<a name='news_".$info['news_id']."'

id='news_".$info['news_id']."'></a>\n";
   
   echo "<div class='news-item floatfix'>\n";
   
   echo "<br /><br /><div class='content'>\n";

      echo

"<div class='info'>\n";
         echo "<span class='title'><a

href='".BASEDIR."welcome.php?readmore=".$info['news_id']."'>".$info['news_subject']."</a></span>\n";
         echo "<br /><br /><span

class='poster'>".newsposter($info, "")."</span>\n";
      echo "</div>\n";
      echo "<div class='image' style='margin-right:5px;'>".$image."</div>\n";      
      echo "<div class='subject'>".$news."</div>\n";
      echo "<div class='footer'>\n";
         echo "<span

class='category'>".newscat($info, " - ")."</span>";
         echo "<span class='read-more'>".newsopts($info, " - ")."</span>";
      echo

"</div>\n";
   echo "</div>\n";
   echo "<div class='clear'><hr /></div>\n";
   
   echo "</div>\n";
}

function render_article($subject, $article, $info) {
   
   echo "<div class='news-item floatfix'>\n";
   
   echo "<div class='content'>\n";
      echo "<div class='info'>\n";
         echo

"<span class='title'>".$subject."</span>\n";
         echo "<br /><br /><span class='poster'>".articleposter($info, "")."</span>\n";
      echo

"</div>\n";
      echo "<div class='subject'>".$article."</div>\n";
      echo "<div class='footer'>\n";
         echo "<span

class='category'>".articlecat($info, " - ")."</span>";
         echo "<span class='read-more'>".articleopts($info, " - ")."</span>";
      echo

"</div>\n";
   echo "</div>\n";
   
   echo "</div>\n";
}

function render_comments($c_data, $c_info){
   global $locale;
   
   opentable($locale['c100']);
   

if (!empty($c_data)){
      echo "<div class='comments floatfix'>\n";
         $c_makepagenav = '';
         if

($c_info['c_makepagenav'] !== false) {
         echo $c_makepagenav = "<div style='text-align:center;margin-bottom:5px;'>".$c_info['c_makepagenav']."</div>\n";
   

   }
         foreach($c_data as $data) {
         echo "<div class='tbl2'>\n";
         if ($data['edit_dell'] !== false) {
   

         echo "<div style='float:right' class='comment_actions'>".$data['edit_dell']."\n</div>\n";
         }
         echo

"<a href='".FUSION_REQUEST."#c".$data['comment_id']."' id='c".$data['comment_id']."' name='c".$data['comment_id']."'>#".$data['i']."</a> |\n";
         echo "<span

class='comment-name'>".$data['comment_name']."</span>\n";
         echo "<span class='small'>".$data['comment_datestamp']."</span>\n";
         

echo "</div>\n<div class='tbl1 comment_message'>".$data['comment_message']."</div>\n";
      }
      echo $c_makepagenav;
      if

($c_info['admin_link'] !== false) {
         echo "<div style='float:right' class='comment_admin'>".$c_info['admin_link']."</div>\n";
      }
      

echo "</div>\n";
   } else {
      echo $locale['c101']."\n";
   }
   closetable();   
}

function opentable($title) {

   echo "<div class='side-panel'>\n";
   echo

"<div class='title'>".$title."</div>\n";

}

function closetable() {

   echo "</div>";

}

function openside($title, $collapse = false, $state = "on") {

   global

$panel_collapse; $panel_collapse = $collapse;
   
   echo "<div class='side-panel'>\n";
   echo "<div class='title'>".$title."</div>\n";
   
   /* echo "<table

cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
   echo "<td class='scapmain-left'></td>\n";
   echo "<td class='scapmain'>".$title."</td>\n";
   if ($collapse ==

true) {
      $boxname = str_replace(" ", "", $title);
      echo "<td class='scapmain' align='right'>".panelbutton($state, $boxname)."</td>\n";
   }
   echo

"<td class='scapmain-right'></td>\n";
   echo "</tr>\n</table>\n";
   echo "<table cellpadding='0' cellspacing='0' width='100%' class='spacer'>\n<tr>\n";
   echo "<td

class='side-body'>\n";   
   if ($collapse == true) { echo panelstate($state, $boxname); } */

}

function closeside() {
   
   global $panel_collapse;

   echo

"</div>\n";
   
   /* if ($panel_collapse == true) { echo "</div>\n"; }   
   echo "</td>\n</tr>\n</table>\n"; */

}
?>
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Morning,

The solution to your problem is that you have not edited includes/theme_functions_include.php at line's 133 and 134 look for...

133
if (!isset($_GET['readmore']) && $info['news_ext'] == "y") $res = "<a href='news.php?readmore=".$info['news_id']."'".$link_class.">".$locale['global_072']."</a> ".$sep." ";


134
if ($info['news_allow_comments'] && $settings['comments_enabled'] == "1") { $res .= "<a href='news.php?readmore=".$info['news_id']."#comments'".$link_class.">".$info['news_comments'].($info['news_comments'] == 1 ? $locale['global_073b'] : $locale['global_073'])."</a> ".$sep." "; }


Change that news.php to your welcome.php
0 replies
S
Samuel
S
Samuel 10
  • Member, joined since
  • Contributed 55 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
answered
Member

Thanks Craig. Problem Solved.
Edited by Samuel on 14-12-2012 21:59,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Your welcome. :)
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
S
S
Samuel 10
  • Member, joined since
  • Contributed 55 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
T
T
  • Member, joined since
  • Contributed 90 posts on the community forums.
  • Started 10 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet