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
Posts: 210
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
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

User avatar
Arvid
FlatPress Coder
Posts: 558
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 40 guests