xF1 Unmaintained - How to show a post in a page | NulledTeam UnderGround | The Best Scripts Site In The World
  • Read Our Rules

    Dont forget read our rules Nulled Team UnderGround Rules

  • You may not say thanks or replied bad language in a thread - Your reply will be removed and warning! You must be like us "overview" in the resource. You will be access to download in FREE SECTION ONLY! DO NOT PREMIUM SECTION! Is only upgrade to up account.
  • Please support our site and click on the advertised
  • Complete Installation Service

    Review Our XenForo Complete Installation Service
  • Multiple Accounts

    Dont forget we not allowed Multiple Accounts, so all of your accounts as well as your IP will ban

How to show a post in a page

xF1 Unmaintained How to show a post in a page 1.0

No permission to download
Compatible XF Versions 1.x
1.0, 1.1, 1.2
Objective:

I will teach you how to show a specific post in a XenForo page.

I strongly recommend you to read my others tutorials to know better how XenForo works.

Step 1 - Creating the code

Let's start by creating the code responsable to get the content of the post.

First thing you need to do is create a new file. You can place this file anywhere, but in this tutorial we will use a dedicated folder for it. Go to your_xenforo_root/library and create this directory structure:

--|library
------|ShowAPost *create this folder*
---------|View.php *create this file*
---------|Index.php *create this file*


The Index.php file will be the file that we will declare the callback class and method to our page. Copy and past the following code:
PHP:
You don't have permission to view the code content.
(The code is all explaned as comments. Please take a time to read all to understand better. The advanced stuff it is not so well explaned, because the objective of this tutorial is simple)

Do not forget to change the postId to what you want:
PHP:
You don't have permission to view the code content.
Save!


Now, open the View.php file. This file will parse all bbcode in the post message.

Copy and paste inside the file:
PHP:
You don't have permission to view the code content.
Step 2 - Creating the page

Now we'll create the page that will show the post you want to show. Go to AdminCP -> Applications -> Create new Page. In the next page, you have some fields to fill. Use the information below:

Basic Information:

  • Url Portion: showapost
  • Title: Show a Post (The title doest not matters, because we'll use the thread title)
  • Description: Show a post inside a page
Basic Information:
  • Template HTML:
Code:
You don't have permission to view the code content.
PHP Callback:​
  • PHP Callback: ShowAPost_Index::showAPostInPage
This is what you will have at the end:








Save the page.

Step 3 - Testing

Now go to your forum list. You should see the page node there:



Click to enter the page and see the result. Your post is now being displayed inside a page!





Tips
  • If you want to show the page title and not the thread title, just change the Template HTMl of the page to this:
Code:
You don't have permission to view the code content.
  • If you want to hide the breadcrumbs put the following code at the TOP of the template HTML of the page:
Code:
You don't have permission to view the code content.
Images

Author
AnimeHaxor
Downloads
0
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from AnimeHaxor

Share this resource

Dear User!

We found that you are blocking the display of ads on our site.

It looks like you're using an ad blocker. That's okay. Who doesn't?

But without advertising-income, we can't keep making this site awesome.

Thank you for understanding!