Codoforum related discussions
Copying index to different folder

Hi,

Can you kindly help me achieve the following:

• I was wondering how I could copy the index page to a different folder such as /news/.

I then plan on assigning that to a specific category, change the html and css so it looks like a news page. (I don't need help with this part).

• I'd like to assign the /news/ page as the index page and not the /forum/ itself.

So when a member goes to www.website.com it will go directly to the news page. This will let me keep the latest Posts on the /forum/ directory.

If you have an easier way around this that would help. Any advice would be greatly appreciated!

Hi, Can you kindly help me achieve the following: • I was wondering how I could copy the index page to a different folder such as /news/. I then plan on assigning that to a specific category, change the html and css so it looks like a news page. (I don't need help with this part). • I'd like to assign the /news/ page as the index page and not the /forum/ itself. So when a member goes to www.website.com it will go directly to the news page. This will let me keep the latest Posts on the /forum/ directory. If you have an easier way around this that would help. Any advice would be greatly appreciated!

Darp

Hi,

So, there will be a category named news and you want to load this category in the front page ?

In other words, instead of getting all topics in the front page, get only the topics from the news category ?

Is this right ?

Hi, So, there will be a category named news and you want to load this category in the front page ? In other words, instead of getting all topics in the front page, get only the topics from the news category ? Is this right ?
Necessity is the mother of all inventions!

Hi,

So, there will be a category named news and you want to load this category in the front page ?

In other words, instead of getting all topics in the front page, get only the topics from the news category ?

Is this right ?

Hello,

No, let me try to clarify.

I am able to show a category on the index page using the cat id via the Topic.php by adding:

AND t.cat_id=X

What I'm ultimately trying to achieve is copying the index into another directory (ei. /news/ and not /forum/). I would then apply the X category there. Then this way I can keep recent topics from all categories on the index of /forum/.

I was then wanting the index page of my website go to the /news/ index and not the /forum/.

This way the news page would show up when they visited the website, and not the forum.

I hope I made sense!

>Hi, >So, there will be a category named news and you want to load this category in the front page ? >In other words, instead of getting all topics in the front page, get only the topics from the news category ? >Is this right ? Hello, No, let me try to clarify. I am able to show a category on the index page using the cat id via the Topic.php by adding: > AND t.cat_id=**X** What I'm ultimately trying to achieve is copying the index into another directory (ei. /news/ and not /forum/). I would then apply the **X category** there. Then this way I can keep recent topics from all categories on the index of /forum/. I was then wanting the index page of my website go to the /news/ index and not the /forum/. This way the news page would show up when they visited the website, and not the forum. I hope I made sense!

Darp

Hi,

You can chage the index page by editing the route in codoforum/routes.php

Create a new route in that file,

dispatch_get('/news/', function() {

     $forum = new \Controller\forum();
     $forum->category($cat_name, 1);
     CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files);


    //Above instead of $cat_name, insert the category alias of your news category
    //it is the cat_alias column from codo_categories table
 });

Then, find the index route ,

dispatch_get('/', function() {


 //here you can copy paste the lines from the 'news' route
//or use php header to redirect.
});
Hi, You can chage the index page by editing the route in codoforum/routes.php Create a new route in that file, ``` dispatch_get('/news/', function() { $forum = new \Controller\forum(); $forum->category($cat_name, 1); CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files); //Above instead of $cat_name, insert the category alias of your news category //it is the cat_alias column from codo_categories table }); ``` Then, find the index route , ``` dispatch_get('/', function() { //here you can copy paste the lines from the 'news' route //or use php header to redirect. }); ```

Hi,

You can chage the index page by editing the route in codoforum/routes.php

Create a new route in that file,

dispatch_get('/news/', function() {

    $forum = new \Controller\forum();
    $forum->category($cat_name, 1);
    CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files);


   //Above instead of $cat_name, insert the category alias of your news category
   //it is the cat_alias column from codo_categories table
});

Then, find the index route ,

dispatch_get('/', function() {


//here you can copy paste the lines from the 'news' route
//or use php header to redirect.
});

Ok, so I can redirect the index page.

How would I go about duplicating the index to a separate page? Because I've modified the script so it shows like other forums:

Topic #Replies Last Post Time
Topic #Replies Last Post Time
Topic #Replies Last Post Time

And that's on the topic/topics files. I am maintaining that structure throughout the forum. I was wanting to duplicate the index so it shows like it does on the stock version, with the post content, etc. I was then going to modify it to look more like a blog, and redirect the index to that that directory.

Am I making sense? Please let me know if I've confused you.

>Hi, >You can chage the index page by editing the route in codoforum/routes.php >Create a new route in that file, >``` >dispatch_get('/news/', function() { > $forum = new \Controller\forum(); > $forum->category($cat_name, 1); > CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files); > //Above instead of $cat_name, insert the category alias of your news category > //it is the cat_alias column from codo_categories table > }); >``` >Then, find the index route , >``` >dispatch_get('/', function() { > //here you can copy paste the lines from the 'news' route >//or use php header to redirect. >}); >``` Ok, so I can redirect the index page. How would I go about duplicating the index to a separate page? Because I've modified the script so it shows like other forums: >Topic #Replies Last Post Time >Topic #Replies Last Post Time >Topic #Replies Last Post Time And that's on the topic/topics files. I am maintaining that structure throughout the forum. I was wanting to duplicate the index so it shows like it does on the stock version, with the post content, etc. I was then going to modify it to look more like a blog, and redirect the index to that that directory. Am I making sense? Please let me know if I've confused you.

Darp

Hi,

Am I making sense? Please let me know if I've confused you.

Yeah, you didsmile

How would I go about duplicating the index to a separate page?

For eg. if your separate page is
http://your_website.com/forum/news/

dispatch_get('/news/', function() {

        $forum = new \Controller\forum();
        $forum->topics(1);
        CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files);
});
Hi, >Am I making sense? Please let me know if I've confused you. Yeah, you did:S >How would I go about duplicating the index to a separate page? For eg. if your separate page is http://your_website.com/forum/news/ ``` dispatch_get('/news/', function() { $forum = new \Controller\forum(); $forum->topics(1); CODOF\Smarty\Layout::load($forum->view, $forum->css_files, $forum->js_files); }); ```
179
5
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft