The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Page Title
#2
Sorry for the slow response. It's been a crazy week. If you look in users/helpers/helpers.php one of the first functions is

Code:
function currentPage() {
Code:
$uri = $_SERVER['PHP_SELF'];
Code:
$path = explode('/', $uri);
Code:
$currentPage = end($path);
Code:
return $currentPage;
Code:
}

So, basically what you could do is make a database table (page_titles) that has 3 columns

id (int 11, auto incremented, primary key)
page (varchar 255)
title (text)

So then you would write something along the lines of...

Code:
$cp = currentPage();
Code:
$currentPageQ = $db->query("SELECT * FROM page_titles WHERE page = ?,"array($cp));
Code:
$currentPage = $currentPageQ->first();

Then you can do your head tag by echoing

Code:
$currentPage->title;

Hope that helps
  Reply


Messages In This Thread
Custom Page Title - by bitsoft - 04-22-2017, 09:21 AM
Custom Page Title - by mudmin - 04-27-2017, 07:08 PM
Custom Page Title - by bitsoft - 04-28-2017, 03:54 PM
Custom Page Title - by eeverts - 10-03-2017, 08:50 AM
Custom Page Title - by karsen - 10-03-2017, 06:34 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)