Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes #88

Closed
wants to merge 41 commits into from
Closed

Some fixes #88

wants to merge 41 commits into from

Conversation

deepend-tildeclub
Copy link
Contributor

I know I'm not the best at handling git stuff.. I've been just going page by page trying to reduce errors and issues.. Restored some functionality that wasn't working like private messages, managing and editing world clocks without error, Some fixes to reduce issues with creating polls.(poll stuff not completely working yet) More to come soon. If you like I will request a pull request for future changes as well. I'm not going to pretend to be an expert but I really want this application to function fully and then can always take it further after that if you like.

error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
the previous change broke being able to name categories.
Fixes some fatal errors relating to the bindparams function.  And Also keeps the naming of categories working properly.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
error reduction mode.
@RedDragonWebDesign
Copy link
Owner

Has this stuff been broken for a long time, or do you think it was a PHP version thing? What PHP version are you using?

@RedDragonWebDesign
Copy link
Owner

Usually when you submit a pull request, you will want to create a new branch in git rather than using the master branch. This gives you the ability to submit multiple PRs at the same time just by changing branches. If you use the master branch for all of them, things get messy. No need to change anything for this PR, but a good tip for future PRs.

@RedDragonWebDesign
Copy link
Owner

In the future, will probably want to split into one PR per feature you worked on. For example, one for private messages, one for world clocks, one for polls. This makes it easier for the reviewer to load it up and test it and reason about it :)

@deepend-tildeclub
Copy link
Contributor Author

Has this stuff been broken for a long time, or do you think it was a PHP version thing? What PHP version are you using?

I haven't had any luck getting a ton of this stuff working in the past. Still want to figure out all the issues relating to the download system.. It really doesn't seem to function properly. Only recently found time to work on rebuilding my site. Some of the depreciated stuff is probably due to PHP version. The server its on is currently using PHP 8.1.20

@deepend-tildeclub
Copy link
Contributor Author

In the future, will probably want to split into one PR per feature you worked on. For example, one for private messages, one for world clocks, one for polls. This makes it easier for the reviewer to load it up and test it and reason about it :)

I will work on doing that in the future, sorry about that.

@@ -58,8 +58,6 @@ public function parse($strText) {
}
else {
$strText = preg_replace(
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to remove this brace? Looks like a syntax error.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, looking at more commits, the brace is still there, but is indented too much. And also preg_replace( is missing a );.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a syntax error from before you started this patch, I would just comment out $strText by adding // to the front of it.

$strText = preg_replace("/\[\youtube\](http|https)(\:\/\/youtu\.be\/)(.*)\[\/youtube\]/i", "<iframe class='youtubeEmbed' src='http://www.youtube.com/embed/$3?wmode=opaque' frameborder='0' allowfullscreen></iframe>", $strText);

$strText = str_replace("[/twitch]", "[/twitch]\n", $strText);
$strText = preg_replace("/\[youtube\](http|https)(\\:\\/\\/www\\.youtube\\.com\\/watch\\?v\\=)(.*)\[\/youtube\]/i", "<iframe class='youtubeEmbed' src='http://www.youtube.com/embed/$3?wmode=opaque' frameborder='0' allowfullscreen></iframe>", $strText);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the old indentation on these lines back. And in the rest of the files please.

On a lot of the lines, you unindented so that the indentation doesn't match the rest of the file. It also makes the git diffs harder to read.

Please use tabs instead of 4 spaces, to match the rest of this repo.

In a good code editor such as VS Code, you can select all the lines you want to indent, then hit tab as many times as needed, and it will scoot them all over to the right.

You can change from 4 spaces to tabs by clicking at the bottom right of VS Code where it says "Tab Size", and click on "Convert Indentation to Tabs"

$sqlValues = rtrim(str_repeat("?, ", count($arrColumns)),", ");

}
public function addNew($arrColumns, $arrValues) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting.


if($intOrderNumID == "first") {
// "(no other categories)" selected, check to see if there are actually no other categories
function validateOrder($intOrderNumID, $strBeforeAfter, $blnEdit = false, $intEditOrderNum = "") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting.

@@ -58,8 +58,6 @@ public function parse($strText) {
}
else {
$strText = preg_replace(
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a syntax error from before you started this patch, I would just comment out $strText by adding // to the front of it.


}

public function bindParams($objMySQLiStmt, $arrValues) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting.

<textarea name='".$componentName."' ".$dispAttributes.">".($componentInfo['value'] ?? '')."</textarea>
</div>
";
// Output input

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting.

$arrPostSelected['multivote'] = ($_POST['multivote'] == 1) ? " checked" : "";
$arrPostSelected['displayvoters'] = ($_POST['displayvoters'] == 1) ? " checked" : "";

if ($countErrors > 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting.

@@ -178,7 +177,7 @@

";

}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a typo? If not, then the indentation of the code below it should be reduced.

echo "
</table>
";
if (count($_SESSION['btPollOptionCache'][$pollObj->cacheID]) > 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting.

echo "

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting.

"sortorder" => $i++,
"value" => $_POST['subject']
),
"subject" => array(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting.

deepend-tildeclub and others added 5 commits January 22, 2024 14:48
Not sure why its moving the { to the next line.   I assume its supposed to be this way not with the { on the line below the function line.
managemenu/_functions: fix globals
.idea/.gitignore Outdated
@@ -0,0 +1,8 @@
# Default ignored files
Copy link
Owner

@RedDragonWebDesign RedDragonWebDesign Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably shouldn't have code editor settings files committed to the git repo. The proper way to fix this is...

  • cut these files into a file outside the repo (to temporarily get them out of the repo, we'll put them back later)
  • commit the file deletions in git (git commit)
  • create a global .gitignore file with the contents /.idea/ (how to create a global .gitignore: https://stackoverflow.com/a/7335487)
  • cut and paste the files back to their original spot

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sorry.. never used this program before.. Didn't know it'd do that. Thanks for your patience with me and the help with great explanations. I usually use a text editor like nano instead. But figure I should probably try something more capable.

* License: http://www.bluethrust.com/license.php
*
*/
/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong. Needs un-indenting.

* License: http://www.bluethrust.com/license.php
*
*/
/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong. Needs un-indenting.

if(!$numericIDOnly) {
$intIDNum = $this->MySQL->real_escape_string($intIDNum);
$checkID = true;
/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong. Needs un-indenting.

* - selectByOrder Method -
*
* Way to select a rank by ordernum. Essentially the same as the normal select method from basic except using the ordernum.
/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong. Needs un-indenting.

@RedDragonWebDesign
Copy link
Owner

RedDragonWebDesign commented Jan 23, 2024

This PR is getting too big. Please don't add any more files to it. Please instead start using git branches as mentioned above, then submit new PRs for groups of files/changes that make sense to group together. Some examples of reasonable groupings:

  • fix world clocks
  • fix private messages
  • fix polls
  • fix PHP 8.1 deprecations/notices/warnings in X folder/file

To create a new git branch...

  • git checkout master - makes sure you're on the master branch, to use it as your "base"
  • git branch fix-world-clocks - creates a new branch called fix-world-clocks. you should pick a name that describes the changes you're about to make.
  • git checkout fix-world-clocks
  • make your code changes
  • save your files
  • git commit
  • git push
  • visit https://github.com/RedDragonWebDesign/BlueThrust5
  • click the green "Create pull request" button at the top

Rinse and repeat.

Each branch is a snapshot of the file contents at a certain point in time. So if you type git checkout master after making the above changes, it will change your local files to match the master branch. Your changes to fix-world-clocks will be temporarily gone from your local files, but will still be saved in git's memory. This allows us to make a bunch of little forks of the master branch, which is useful for PRs.

@deepend-tildeclub
Copy link
Contributor Author

This PR is getting too big. Please don't add any more files to it. Please instead start using git branches as mentioned above, then submit new PRs for groups of files/changes that make sense to group together. Some examples of reasonable groupings:

* fix world clocks

* fix private messages

* fix polls

* fix PHP 8.1 deprecations/notices/warnings in X folder/file

To create a new git branch...

* `git checkout master` - makes sure you're on the master branch, to use it as your "base"

* `git branch fix-world-clocks` - creates a new branch called fix-world-clocks. you should pick a name that describes the changes you're about to make.

* `git checkout fix-world-clocks`

* make your code changes

* save your files

* `git commit`

* `git push`

* visit https://github.com/RedDragonWebDesign/BlueThrust5

* click the green "Create pull request" button at the top

Rinse and repeat.

Each branch is a snapshot of the file contents at a certain point in time. So if you type git checkout master after making the above changes, it will change your local files to match the master branch. Your changes to fix-world-clocks will be temporarily gone from your local files, but will still be saved in git's memory. This allows us to make a bunch of little forks of the master branch, which is useful for PRs.

I can definitely do that. If you like we can just close this PR and I'll resubmit once I've sorted all this out?

@RedDragonWebDesign
Copy link
Owner

Sure. That will be a lot of work, but if you're willing, that is definitely the most organized way to do it.

@deepend-tildeclub
Copy link
Contributor Author

Sure. That will be a lot of work, but if you're willing, that is definitely the most organized way to do it.

I can try my best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants