own plugin with widget for PHP Web Stat Counter

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
User avatar
fraenkiman
FlatPress Coder
Posts: 547
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

own plugin with widget for PHP Web Stat Counter

Post by fraenkiman » Thu Feb 03, 2022 7:51 pm

Hi, everyone,

I use Flatpress 1.2.1 and want to create a plugin for a counter (PHP Web Stat).

The plugin must ensure the following:
-Plugin includes a widget
-the widget should load the counter.php via <iframe></iframe> and display it in the navigation on the right.

Code: Select all

<?php
/*
 * Plugin Name: Counter
 * Version: 1.0
 * Plugin URI:
 * Author:
 * Author URI:
 * Description: Counter
 */

function plugin_counter_widget() {
	$baseurl = BLOG_BASEURL;
			echo '<p><iframe name="stat_counter" src=" . BLOG_BASEURL . /stat/counter.php" style="width:140px; height:150px; border:none; overflow:hidden;"></iframe></p>'
	;
}

register_widget('counter', 'Counter', 'plugin_counter_widget');

?>

Maybe someone can correct the PHP and HTML code for me.

I apologize for my bad english
Best Regards
Frank
πŸ“ Project blogβ€ƒβ€ƒπŸ“– Docsβ€ƒβ€ƒπŸ˜ Mastodonβ€ƒβ€ƒπŸ“œ Forum RSS feedβ€ƒβ€ƒπŸ“œ Project blog RSS feedβ€ƒβ€ƒπŸ± GitHub  ❀️ Donate

My :de: FlatPress-Blog: https://frank-web.flatpress.org, synced with :elephant: Mastodon

User avatar
Arvid
FlatPress Coder
Posts: 630
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: own plugin with widget for PHP Web Stat Counter

Post by Arvid » Sun Mar 13, 2022 12:51 pm

fraenkiman, welcome to the FlatPress support forum! :)

The plugin seems a good idea to me, what problems are you running into exactly?

All the best,
Arvid

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests