FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » My local forum hacks and improvements
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
My local forum hacks and improvements [message #168082] Sat, 19 January 2013 02:19 Go to next message
Atomicrun is currently offline  Atomicrun   Sweden
Messages: 54
Registered: November 2010
Location: Lund
Karma: 0
Member
add to buddy list
ignore all messages by this user
TAGS IN THE CODE
I would like the src files, and the theme files, to include their ID tags into the produced HTML. Suggest a global forum option to include the generation of these tags. The purpose is to allow HTML tools/code inspection to track which original files produced the resulting HTML.
This is an alternative into producing some kind of documentation, that may or may not help, and also needs frequent updates.
The use would typically be when you disprove of a function enough so you start to search for a source code hack on your own local forum.

Implementation as a HTML comment, that can be seen only by CTRL-U or typical HTML/php developer tools.

echo '<!-- $Id: finduser.php.t -->';
$pageprocessing .= ' $Id: finduser.php.t';


To be of real value, each src/template needs to have their ID shipped with the function, so they are output in association with the calculated result. An additional use could be to also output debug data from the source:
echo "\n". '<!-- TAG: usr->users_opt = '. $usr->users_opt. ' -->';
echo "\n". '<!-- TAG: is_a = '. $is_a. ' -->';
(There would be some documentation of these bit fields somewhere...)


FILE UPDATE BUTTON
When hacking in the forum source, frequent updates occur on typically the same file, such as the css file or a template/php source. In the file manager, when reloading the page, I would like to see the last uploaded file to appear with an update/reload button, to simply repeat the last file forum upload:

LAST SOURCE FILE: D:\Webb\randomserver\php_edit_FUDforum\FUD_Edit\DATA_src_tufavideo\finduser.php.t
DESTINATION: D:\FUDforum_tufa\src


Button: [UPDATE FILE]
Thank you!


ADDITIONAL FIXED PATH IN THE FILE SYSTEM
In the file administration system, I have included a fixed link to the tmp directory of the "Data" part on the server.

Currently browsing: D:\FUDforum_tufa\src
Go to: [ Web Directory ] [ Data Directory ] [ Data TMP Directory ]

I don't have ftp access to the server, but I do have physical access, so I use the /tmp directory to transfer various files like the Apache config file. The button make it easy to access this directory.

File is /adm/admbrowse.php that also include the "function dl_file_resume( $file)" that has been previously posted and also partially included on the forum.

echo 'Currently browsing: <b>'. htmlspecialchars($cur_dir) ."</b><br />\n";
if ( $ROOT_PATH[ 0] == $ROOT_PATH[ 1]) 
{
   if ( $ROOT_PATH[ 0] != $cur_dir) 
   {
      echo 'Go to: ';
      echo '[ <a href="admbrowse.php?'. __adm_rsid. '&amp;cur='. urlencode( $ROOT_PATH[ 0]). '" title="Navigate to '. htmlentities( $ROOT_PATH[ 0]). '">Forum Root Directory</a> ]<br />';
   }
} 
else 
{
   echo 'Go to: ';
   echo '[ <a href="admbrowse.php?'. __adm_rsid. '&amp;cur='. urlencode( $ROOT_PATH[0]). '" title="Navigate to '. htmlentities( $ROOT_PATH[ 0]). '">Web Directory</a> ] ';
   echo '[ <a href="admbrowse.php?'. __adm_rsid. '&amp;cur='. urlencode( $ROOT_PATH[1]). '" title="Navigate to '. htmlentities( $ROOT_PATH[ 1]). '">Data Directory</a> ] ';
   echo '[ <a href="admbrowse.php?'. __adm_rsid. '&amp;cur='. urlencode( $ROOT_PATH[1].  '/tmp').'" title="Navigate to '. htmlentities( $ROOT_PATH[ 1]. '/tmp'). '">Data TMP Directory</a> ]<br />';
}


SORT FILES ON DATE IN THE FILE SYSTEM
I would prefer if the default sorting of files is by date, with newest file first. This will put all unedited forum files at the bottom, and the latest edited file, or backup file, on top.
Please kindly consider implementing a file sort by date that is correct and works. If there is a problem or lack of interest, simply replace the brain-dead U.S. style of date format with the YYYY-MM-DD HH:MM:SS format on a 24 hour clock system-wide.
I feel rather confident that also U.S. admins actually prefer a working sort, compared to the custom U.S. style date format. Mix your own alternative in compromise between elegance and effort.


REMOVE USERS WITHOUT POSTS IN THE USER LIST
There seems to be a series of bots that register accounts on the forum, and include links to consumer goods, possibly to improve the google ranking. Due to this I remove all users from the user-list that don't have any posts.

A moderator or Admin may list all users by searching for user "*". Sorting of the list still works, but you may have to enter the "*" in the page URL. I use this as default also on the Admin accounts in order not to get upset by the many bogus entries.

File: /src/finduser.php.t
   $restriction = 'posted_msg_count > 0 AND ';
   if (    ( $usr->users_opt & 524288 || $is_a)
        && ( $usr_login == '*'))
   {
      $restriction = ' ';
      $usr_login = '';
   }

It is the inclusion of the restriction "posted_msg_count > 0" that remove all accounts with zero posts. You may enter a higher value if you please.

Insert the $restriction in the data-base search:
$c = uq(q_limit('SELECT /*!40000 SQL_CALC_FOUND_ROWS */ flag_cc, flag_country, home_page, users_opt, alias, join_date, posted_msg_count, id, custom_color, last_visit FROM {SQL_TABLE_PREFIX}users WHERE '. $restriction. $qry .' id>1 AND '. q_bitand('users_opt', 1073741824) .' = 0 ORDER BY '. $ord,
			$MEMBERS_PER_PAGE, $start));

You may check how this works this on the randomserver forum.


INCLUDE THINGS ON THE INDEX PAGE
The randomserver include the server status on the front page. My problem is that I cannot find the spot where my additional code should be inserted. The result is that I have to manually edit this into the index.php for every language alternative.

My add is an empty box, where the contents get loaded from a client side java script.

FILE: /theme/default_***/index.php
What I want included is (bottom of file):

</div>

<?php 
   $Test_ip_arr = explode( '.', $_SERVER[ "REMOTE_ADDR"], 4);
   if ( ! isset( $_GET[ 't']) || $_GET[ 't'] == 'index' || $_GET[ 't'] == 'i')
   {
      if ( $Test_ip_arr[ 0] === '192' && $Test_ip_arr[ 1] === '168' )
      {      
         readfile( 'D:/Apache/htdocs/forum/serverinfo/server_update_50.js');
      }
      else
      {
         readfile( 'D:/Apache/htdocs/forum/serverinfo/server_update.js');
      }
   }
?>
<div class="footer ac">


The purpose of this entry is simply to allow discussion of the topics.
I still run the 3.0.3 version of the forum.
Re: My local forum hacks and improvements [message #168088 is a reply to message #168082] Thu, 24 January 2013 11:24 Go to previous messageGo to next message
NeXuS is currently offline  NeXuS
Messages: 121
Registered: July 2010
Location: South Korea
Karma: 5
Senior Member
Contributing Core Developer
add to buddy list
ignore all messages by this user
I would first like to point out that this answer reflects my personal views and what I am doing on a separate branch of the FUDf code, it doesn't have anything to do with Frank's plans as FUDf mantainer (although he seemed pleased at the general direction I chose).

Atomicrun wrote on Sat, 19 January 2013 16:19

TAGS IN THE CODE
I would like the src files, and the theme files, to include their ID tags into the produced HTML.


I am currently working on what you might think of the FUDf "next-gen" and I am deliberately dropping the whole template thing in favor of a simpler and easier to hack MVC approach. Thus, such feature wouldn't be required anymore.

Quote:

FILE UPDATE BUTTON
When hacking in the forum source, frequent updates occur on typically the same file, such as the css file or a template/php source. In the file manager, when reloading the page, I would like to see the last uploaded file to appear with an update/reload button, to simply repeat the last file forum upload.


See above. Ideally there will be no more templates.

Quote:

ADDITIONAL FIXED PATH IN THE FILE SYSTEM
In the file administration system, I have included a fixed link to the tmp directory of the "Data" part on the server.

Currently browsing: D:\FUDforum_tufa\src
Go to: [ Web Directory ] [ Data Directory ] [ Data TMP Directory ]

I don't have ftp access to the server, but I do have physical access, so I use the /tmp directory to transfer various files like the Apache config file. The button make it easy to access this directory.


I am sorry but what you are saying is puzzling at least. Why would you use the /tmp directory to transfer files if you have physical access? Furthermore, you using the /tmp directory doesn't mean that everybody does or even that the directory exists (e.g. Windows server).

Quote:

SORT FILES ON DATE IN THE FILE SYSTEM
I would prefer if the default sorting of files is by date, with newest file first. This will put all unedited forum files at the bottom, and the latest edited file, or backup file, on top.


Actually a nice suggestion. The admin panel is also going to be completely redesigned in my version.

Quote:

REMOVE USERS WITHOUT POSTS IN THE USER LIST
There seems to be a series of bots that register accounts on the forum, and include links to consumer goods, possibly to improve the google ranking. Due to this I remove all users from the user-list that don't have any posts.


Another reasonable suggestion.

Quote:

INCLUDE THINGS ON THE INDEX PAGE
The randomserver include the server status on the front page. My problem is that I cannot find the spot where my additional code should be inserted. The result is that I have to manually edit this into the index.php for every language alternative.


See above. The abolition of templates should make things much easier.

Unfortunately I don't plan to work on the current branch unless for security or performance critical updates, so I can't promise any swift result.
Re: My local forum hacks and improvements [message #168103 is a reply to message #168088] Sun, 27 January 2013 02:20 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
I've committed a fix to "format file dates & sizes to make them sortable" at
http://fudforum.svn.sourceforge.net/fudforum/?rev=5585&view=rev
Re: My local forum hacks and improvements [message #168193 is a reply to message #168103] Sun, 24 February 2013 13:45 Go to previous message
Atomicrun is currently offline  Atomicrun   Sweden
Messages: 54
Registered: November 2010
Location: Lund
Karma: 0
Member
add to buddy list
ignore all messages by this user
I wish to clarify that the "ADDITIONAL FIXED PATH IN THE FILE SYSTEM" refer to the FUD-Forum tmp directory, and not any other tmp directory. This is the directory where a forum backup will be put as a default.
Data TMP Directory:
urlencode( $ROOT_PATH[1]. '/tmp')

I do have physical access to my server, which is very nice, but I don't have USB, and I don't have any FTP, and I possibly have a CD reader, but it can be full of dust. So I simply send my files through the FUDForum admin panel, and then drag&drop the files to the right place. I admit that this configuration is possibly not very common among forum admins. But a super-thank-you for the file section of the Admin panel !!

The system-problem of a forum set-up is to keep the different parts separate, and bring them together when a user loads a page.
1) the Source code
2) the source code Hacks/Addons
3) the Style (what it looks like)
4) the Colour Scheme (Gray or Green or Blue)
5) the Language

This can be done using a database, but multiplying the set and pre-compute all files, it seems to be a solution that would also work. Currently I cannot configure language and style ("theme") independent of each other.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Paypal Donation Button
Next Topic: Facebook Connect
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Oct 19 05:01:58 EDT 2017

Total time taken to generate the page: 0.00678 seconds