adding a toplist script to the site

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
User avatar
TheButcher2
Registered User
Posts: 1034
Joined: Tue May 13, 2014 11:38 pm

Re: adding a toplist script to the site

Post by TheButcher2 »

Mannix_ wrote: Tue Oct 10, 2023 9:43 am do you really need php to display a bunch of links ???


Hi Mannix

What I want to show is the toplist, it works on WP you can see it here if you wish

https://www.sponsorchat.com/directory/
at the bottom


Peace
User avatar
TheButcher2
Registered User
Posts: 1034
Joined: Tue May 13, 2014 11:38 pm

Re: adding a toplist script to the site

Post by TheButcher2 »

Any new tips?


Peace
User avatar
ForumFlair
Registered User
Posts: 90
Joined: Sun Jan 31, 2021 10:21 pm

Re: adding a toplist script to the site

Post by ForumFlair »

TheButcher2 wrote: Wed Oct 18, 2023 7:38 pm Any new tips?

From the phpBB 3.3.8 release notes:
Marc wrote: We are pleased to announce the release of phpBB 3.3.8 “Bertie: Beer and Summer”. This version is a maintenance release of the 3.3.x branch which marks the PHP and INCLUDEPHP template functions as deprecated in order for them to be removed in a future release.

We have also decided to deprecate the use of the PHP and INCLUDEPHP as part of the phpBB template syntax. These are rarely used, have a high potential to cause issues or be used incorrectly, and also have not been recommended for a longer period of time. These functions have now been marked as deprecated and will no longer be available in the next feature release of phpBB, i.e. 3.4.0 or 4.0.0.

- The phpBB Team

It may be best to start looking at alternative methods so that you are prepared for the future.
ForumFlair
WMP
Registered User
Posts: 72
Joined: Tue Sep 19, 2023 3:31 am
Location: America

Re: adding a toplist script to the site

Post by WMP »

The script that Butcher is talking about is TradeExpert.net info ..

The script manages traffic exchanges and outputs it into a list.htm template that needs to be included into either the overall-header.html or the overall_footer.html or both.

The include line needed for the script to output the data is similar to this:

Code: Select all

<?php include "/ROOT_PATH/public_html/TRADE_EXPERT_INSTALL_FOLDER/toplist/top_10_links.htm";?>
The code that the script template uses is similar to this. Which will output 10 text links with a description according to rank (traffic in):

Code: Select all

<div class="col">
          <div class="card site-card-border site-card-body h-100">
			    <div class="mx-1 site-card-body p-3 text-black-50">
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:1##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:1##</a> - ##long:desc:1##</p>
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:2##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:2##</a> - ##long:desc:2##</p>
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:3##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:3##</a> - ##long:desc:3##</p>
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:4##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:4##</a> - ##long:desc:4##</p>
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:5##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:5##</a> - ##long:desc:5##</p>
			    </div>
          </div>
		</div>
		<div class="col">
          <div class="card site-card-border site-card-body h-100">
			    <div class="mx-1 site-card-body p-3 text-black-50">
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:6##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:6##</a> - ##long:desc:6##</p>
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:7##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:7##</a> - ##long:desc:7##</p>
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:8##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:8##</a> - ##long:desc:8##</p>
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:9##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:9##</a> - ##long:desc:9##</p>
				  <p> <a href="/TRADE_EXPERT_INSTALL_FOLDER/out.php?id=##domain:10##" class="cardlink fw-bold" rel="sponsored" target="_blank">##name:10##</a> - ##long:desc:10##</p>
			    </div>
          </div>
		</div
The script uses that type template syntax and outputs updated data into the list to display in the overall_header.html and or the overall_footer.html

All phpbb needs to do is to be able to use the include line and output the info ..using an include line similar to this:

Code: Select all

<?php include "/ROOT_PATH/public_html/TRADE_EXPERT_INSTALL_FOLDER/toplist/top_10_links.htm";?>
So, basically, the question is, 'What is the Trick' to being able to include php, and or htm templates into phpbb header and or footer?
User avatar
ForumFlair
Registered User
Posts: 90
Joined: Sun Jan 31, 2021 10:21 pm

Re: adding a toplist script to the site

Post by ForumFlair »

WMP wrote: Fri Oct 20, 2023 6:52 pm So, basically, the question is, 'What is the Trick' to being able to include php, and or htm templates into phpbb header and or footer?

There was a post in the phpBB 3.3.8 release discussion topic which elaborates on it a little more:
Marc wrote:
Frank Rizzo wrote: With reference to the deprecation of <!-- PHP -->

I use this in order to process session information from another part of my website; namely subscriptions and to show / limit various parts of the forum. How can I now do this if I can't run my own PHP code?

simplified example

Code: Select all

<!-- PHP -->
if($_SESSION['valid_subscription'] == 1) {
	// display forum here
} else {
	echo '<div class="alert alert-warning"><h4>This section is for subscribers only</h4></div>';
}
</-- ENDPHP -->
The recommended way of handling this is via a small extension that employs our events system. If you need a more detailed help with that, we'll be happy to support you. Please open a topic in the appropriate section.
ForumFlair
User avatar
TheButcher2
Registered User
Posts: 1034
Joined: Tue May 13, 2014 11:38 pm

Re: adding a toplist script to the site

Post by TheButcher2 »

Problem solved it is on the site in the footer.

Return to “phpBB Custom Coding”