e_frontpage.php

add your plugin to Frontpage settings

To add your plugin page to Frontpage options:

58f9d49838a3

You should know already what is Frontpage and how to use it.

8b6c1bed6789

Create file e_frontpage.php in your plugin folder (see _blank plugin for example).

Bellow is real example from content plugin:

class name = plugin name "_frontpage";

Note: with new plugin you should use new way how to load language strings.

if (!defined('e107_INIT')) { exit; }

include_lan(e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content_frontpage.php');

class content_frontpage // include plugin-folder in the name.<br />
{
	// simple
	function config()
	{
	  $frontPage = array();
		$frontPage['title'] = CONT_FP_3;
		$frontPage['page'] = 'e107_plugins/content/content.php';		
		return $frontPage;
	}
	
}


This is easy and you can find examples in other plugins too. Just look for e_frontpage.php file.

B4102e5626ac

But the content plugin separates content to sections and you maybe want to have the possibility to set different sections for different userclasses.

class content_frontpage
{
	function config()
	{
		$frontPage = array();
		$frontPage['title'] = CONT_FP_3;
		$frontPage['page'][0] = array(
			'page' => 'e107_plugins/content/content.php',
			'title' => CONT_FP_2
		);
		if ($maincat = e107::getDb()->retrieve("pcontent", "content_id, content_heading", 
		" WHERE content_parent='0'", true))
		{
			$i = 1;
			foreach($maincat as $row)
			{
				$row['url_content_id'] = $row['content_id'];
				$frontPage['page'][$i] = array(
					'page' => $PLUGINS_DIRECTORY . 'content/content.php?recent.' . $row['content_id'],
					'title' => CONT_FP_1 . ': ' . $row['content_heading']
				);
				  $i;                                                                            
				
				if ($subpages = e107::getDb()->retrieve("pcontent", "content_id, content_heading", 
				" WHERE LEFT(content_parent,1) = '" . $row['content_id'] . "' ORDER BY content_heading", TRUE))
				{
					foreach($subpages as $row2)
					{
						$frontPage['page'][$i] = array(<br />
							'page' => 'e107_plugins/content/content.php?content.' . $row2['content_id'],
							'title' =>  ' - ' . $row['content_heading'] . ' - ' . $row2['content_heading']
						);
						  $i;
					}
				}
			}
		}

		return $frontPage;
	}
}


002822f8dee9


Known issues with Frontpage:

Fatal error: require_once(): Failed opening required '../../class2.php'


This:

require_once('../../class2.php');


Need to be changed to:

if(!defined('e107_INIT')) 
{ 
	require_once('../../class2.php'); 
}

Comparing with version 1.0.4:


- old ways with arrays are not supported, you need to rewrite this file to new standards
- there is a change in behavior in version 2 - one plugin can have just one line in Frontpage. This is not possible now (or yet):

664b94dda82a



Notes:

* For layout/look is FRONTPAGE layout applied (if it's used), not defined layout for original URL.
* you can set different frontpage for any userclass,
* you can set after login page this way too different for userclasses
* you can extend frontpage of core plugins this way too - just create your own plugin and create options with core tables (for example download categories)

Account

Right Sidebar



  • Jimako
    Jimako  5 months ago

    Here is new chatbox plugin (not new, just updated and fixed)

  • Jimako
    Jimako  2 years ago

    @kreossino Hi, yes, everything is ok.

  • kreossino
    kreossino  2 years ago

    heyyy tutto ok????? ...!!!!

  • Jimako
    Jimako  2 years ago

    Thanks for testing. And next funny thing - I forgot to uninstall APOS plugin, so it still created welcome post for you in forum, but forum is not installed... Just a reminder to look at it.

  • Tgtje
    Tgtje  2 years ago

    @Jimako just info : 1st activ. mail not received (2 day wait), resend ok (20 seconds) wink .

  • Jimako
    Jimako  2 years ago

    test first message biglaugh confused

  • Jimako
    Jimako  3 years ago

    @Alex try this one: https://cookie-script.com/

  • Jimako
    Jimako  3 years ago

    In fact, I have never notice this because with WP plugin it is free. I will see what it does after free trial.

  • Alex
    Alex  3 years ago

    Well it's nice but 10 dollar a month for a business use pro domain... that costs more than the hosting frown

  • Jimako
    Jimako  3 years ago

    And yes, it works very nicely... I use it long time. Just first or second time used on e107 site.


Smart move on repo setup Using similar with langua [more ...]
Tgtje 2 years ago
Updated path where download this older version.
Jimako 2 years ago
Now I see that I need to fix comments layout for 2 [more ...]
Jimako 3 years ago
Thx Jimako, the website should look outdated, that [more ...]
Alex 3 years ago
Themes are next on list. I use it mainly for swit [more ...]
Jimako 4 years ago
Nice one J, so if i understand this right i could [more ...]
Alex 4 years ago

Jimako 1 week ago
kreossino 3 months ago
mr 4 months ago
gandsnut 5 months ago
hersul8007 6 months ago
Martin 1 year ago
belr 1 year ago
FloKysLo 1 year ago
Viktor 1 year ago
Allan 1 year ago