The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
Messaging System Mods - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29)
+--- Thread: Messaging System Mods (/showthread.php?tid=615)

Pages: 1 2 3 4


Messaging System Mods - faguss - 07-04-2017

Following changes from here I've made these:
view_all_users.php
profile.php
Path to JS scripts were modified.

Also modified messages.php:
57-61, 73-74, 88-91 - Error conditions
165-167, 278-280 - uses G+ avatar

Also minor changes to navigation.php:
71 - don't display "Messages" in the navigation bar if there aren't any
84 - displays singular noun if there's only 1 message


Messaging System Mods - Brandin - 07-04-2017

@Firestorm - awesome idea! Will work on that next!


Messaging System Mods - Brandin - 07-06-2017

@faguss - just seeing this now - thank you! When I post my new updates I will ensure to take your patches in with mine!

Thank you!


Messaging System Mods - Brandin - 07-06-2017

@mudmin @firestorm - do you guys know how to make these checkboxes multiple purpose driven by buttons? If I understand them correctly, the "unarchive" prior to the ID in the name of the checkbox is what drives the
Code:
if (!empty($_POST['unarchive']))
command...or am I wrong on this? If I am right, do you know how I can go about leaving the name attribute with the ID only, and appending a prefix of "unarchive" or "delete" based on the button selected (unarchive selected threads or delete selected threads)?


Messaging System Mods - Brandin - 07-06-2017

FYI - here is the latest haste!

Implemented the patches from @faguss (thanks again!), moved JS into one file and tweaked the custom functions!

Code:
messages.php
https://hastebin.com/fuxinejofe.xml

Code:
message.php
https://hastebin.com/oligiloxoq.xml

Append to
Code:
custom_functions.php
:
https://hastebin.com/ovusewolul.php

Add in /scripts/
Code:
messages.php.js
:
https://hastebin.com/lezajejiwe.js

Add this to your
Code:
custom.css
or whenever you call your custom CSS from:
https://hastebin.com/itiwoxites.css

You can put it inline if you want, but I prefer it in my custom so I can use it anywhere in the system!

Last but not least, the new exempt setting:
https://hastebin.com/kegacijoqi.sql
Modify this to include what you wish, or keep it NULL.

Edit this in your DB until I make the admin function to control this.

On my list:
-Admin function for exempt feature
-Admin snooping page, landing with pagnation, can be filtered by date or user_id
-Delete archived threads

Let me know if you want anything else!

Don't forget Jwerty and ComboBox at the beginning of this thread!


Messaging System Mods - firestorm - 07-06-2017



Quote:@mudmin @firestorm – do you guys know how to make these checkboxes multiple purpose driven by buttons? If I understand them correctly, the “unarchive” prior to the ID in the name of the checkbox is what drives the if (!empty($_POST['unarchive'])) command…or am I wrong on this? If I am right, do you know how I can go about leaving the name attribute with the ID only, and appending a prefix of “unarchive” or “delete” based on the button selected (unarchive selected threads or delete selected threads)?

if i understand your question correctly,
Code:
$_POST['unarchive']
is triggered by the name attribute like:

Code:
<input type="checkbox" class="check-all" name="unarchive"/>

checkout the backup script in admin_backup.php and where commented as existing backups you'll see a working example of checkboxes triggered by buttons, you can select single,mutiple or all checkboxes then select the delete button to submit them, the php is near the top of the page at the end of the php logic.

hopefully I've got the correct gist of your question


Messaging System Mods - faguss - 07-10-2017

On my host using "NOT IN ()" is invalid so I've added condition replace empty data with zero. Plus I only retrieve required columns instead of everything.

Function
Code:
fetchMessageUsers()
is used twice which isn't necessary. I actually removed this function and instead make a query on the top.

https://pastebin.com/XMLGFXVv (lines 34-39).

Column msg_exempt violates 1NF guideline. A different way would be to make a new column in users table or create a new table.

Also the same avatar-related modification from messages.php applies to message.php as well.


Messaging System Mods - Brandin - 07-13-2017

@Firestorm

You got most of it - but I am wondering if I can make the checkbox in the archive modal serve two functions - archive and delete - but it does whichever function based on the button pressed. E.g. I select all the items in the archive modal and press "Delete", so it deletes them, or in another circumstance I can check all and press the "Archive" button so it archives them. Can this be accomplished?

@faguss - thank you for cleaning this up for me. As I said before this is pretty slapped together until I get it fully deployed, debugged, etc. I will continue to move these in to supply to @Mudmin for the project if he wishes to deploy.


Messaging System Mods - karsen - 07-15-2017

You can have your checkboxes do multiple things by keeping everything in one form. In your $_POST array, your submit button value will be whichever button was pressed.

Code:
<form name="testForm" action="test.php" method="post">
Code:
<input type="checkbox" name="checkbox1" /> Checkbox 1<br />
Code:
<input type="checkbox" name="checkbox2" /> Checkbox 2<br />
Code:
<input type="checkbox" name="checkbox3" /> Checkbox 3
Code:
<div class="text-center">
Code:
<input type="hidden" name="csrf" value="<?= $token; ?>" />
Code:
<input type="submit" name="testFormSubmit" value="Archive" class="btn btn-default" />
Code:
<input type="submit" name="testFormSubmit" value="Delete" class="btn btn-default" />
Code:
</div>
Code:
</form>
Code:
echo 'This is the POST data when the Archive button and some checkboxes are pressed:
Code:
print_r($_POST);
Code:
Array
Code:
(
Code:
[checkbox1] => on
Code:
[checkbox3] => on
Code:
[csrf] => 99f54e1d96a818733f1d3e98a1bc6101
Code:
[testFormSubmit] => Archive
Code:
)



Messaging System Mods - Brandin - 07-18-2017

Hey @Karsen,

Thanks for this info! I'll tried to deploy this however I'm running into some issues - it's no longer posting for unarchive or delete. It looks like it is related to me removing the "unarchive" value from the ID in the checkbox. I need to migrate the "unarchive" value from here, so instead of being controlled per checkbox, the checkboxs action is controlled by the form button selected "Delete" or "Archive". I have posted my haste below, any thoughts?

https://hastebin.com/qojoqojuxi.xml