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

Home » FUDforum » FUDforum Suggestions » My local forum hacks and improvements
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
My local forum hacks and improvements [message #168082] Sat, 19 January 2013 07:19 Go to previous message
Atomicrun is currently offline  Atomicrun   Sweden
Messages: 54
Registered: November 2010
Location: Lund
Karma:
Member
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.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Paypal Donation Button
Next Topic: Facebook Connect
Goto Forum:
  

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

Current Time: Sun Nov 24 14:16:16 GMT 2024

Total time taken to generate the page: 0.04667 seconds