Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: back button after error message  (Read 3548 times)

0 Members and 1 Guest are viewing this topic.

durangod

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
back button after error message
« on: January 01, 2010, 05:51:57 pm »

hi, i have had this for about a week now and love it, i have done well to get this far without joining the forum, i wanted to challenge myself but this issue is just taking up alot of time and i cant figure it out, i have done searchs on form but cannot seem to find what i need, and nothing in documentation.

here is a link to my gallery, http://www.durangodaves.com/ddfotoup/index.php

Here is my question, im trying to clean up all the error messages that do not have a back button or continue button, i have done a pretty good job so far with getting the little things fixed and cleaning up some of the mods and figuring it out for myself but this one has me perplexed

in the ratepic.php file in the error routine i want to add a back or continue button to the error box, (i could just add expanitory text to the lang file but i dont want to do that) i want an actual button,  i can see the routine at the bottom not only for the error such as calling the forbidden variable out of lang file and i can see at the very bottom where the routine is to do the refresh, i just dont know what part of the code to put where..  here is the bottom portion of the ratepic.php and i have bolded the section in particular, one bold are in the error creator section and one bold area in the refresh section, how do i combine them to work.. what do i add the the error section to get a back or continue button to display.

Code: [Select]
[b]if (!empty($user) && $user==$owner && !USER_IS_ADMIN) cpg_die(ERROR, $lang_rate_pic_php['forbidden'], __FILE__, __LINE__);[/b]// Update picture rating
$new_rating = round(($row['votes'] * $row['pic_rating'] + $rate * 2000) / ($row['votes'] + 1));
$sql = "UPDATE {$CONFIG['TABLE_PICTURES']} " . "SET pic_rating = '$new_rating', votes = votes + 1 " . "WHERE pid = '$pic' LIMIT 1";
$result = cpg_db_query($sql);
// Update the votes table
$sql = "INSERT INTO {$CONFIG['TABLE_VOTES']} " . "VALUES ('$pic', '$user_md5_id', '$curr_time')";
$result = cpg_db_query($sql);

/**
 * Code to record the details of hits for the picture if the option is set in CONFIG
 */
if ($CONFIG['vote_details']) {
$client_details = cpg_determine_client();
// Get the details of user browser, IP, OS, etc
$os = $client_details['os'];
$browser = $client_details['browser'];
$time = time();
$referer = addslashes(htmlentities($_SERVER['HTTP_REFERER']));
// Insert the record in database
$query = "INSERT INTO {$CONFIG['TABLE_VOTE_STATS']}
                 SET
                    pid = $pic,
                    rating = $rate,
                    Ip   = '$raw_ip',
                    sdate = '$time',
                    referer = '$referer',
                    browser = '$browser',
                    os = '$os'";
cpg_db_query($query);
}

[b]$location = "displayimage.php?pos=" . (- $pic);
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';
header($header_location . $location);
pageheader($lang_info, "<META http-equiv=\"refresh\" content=\"1;url=$location\">");
msg_box($lang_info, $lang_rate_pic_php['rate_ok'], $lang_continue, $location);[/b]
pagefooter();
ob_end_flush();

?>

thanks fo your time
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: back button after error message
« Reply #1 on: January 01, 2010, 06:29:03 pm »

Although not a "button" - this method works well for me. Read all of the posts in the thread.

   
All Themes - Error Recovery and Return for Users - cpg_die page

durangod

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: back button after error message
« Reply #2 on: January 01, 2010, 08:32:39 pm »

thank  you both, works perfect !!   by the way A+ on the whole software and its documentation, i have had a very nice experience so far and very impressive work...  thanks for the help..
Logged

durangod

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: back button after error message
« Reply #3 on: January 02, 2010, 01:34:58 am »

just out of curiosity would that back option mod i installed in the other link (the page write) have anything to do with my recapture mod not working now..mmmmmm  i have not made any other changes but some minor home page changes for my paypal, thats the only major change...  any ideas... ill try to uninstall in and install the mod again.
Logged

durangod

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: back button after error message
« Reply #4 on: January 02, 2010, 02:21:15 am »

well thats not it, i removed all code that i entered and uninstalled recapture and reinstalled and its not working, all of a sudden just like that its not working.... strange.. it does not even come up its just a normal login box..
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: back button after error message
« Reply #5 on: January 02, 2010, 01:11:32 pm »

Gallery looks to have Captcha 3.0 plugin installed. If you are referring to reCAPTCHA v2.5 plugin not working then it is likely that a file mod. is getting in the way of the plugin - start with clean, unmodified files. Changing the cpg_die message should not affect other Coppermine functions.

durangod

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: back button after error message
« Reply #6 on: January 02, 2010, 04:38:48 pm »

ok thanks appreciate that, since this post title is not about captcha, this will be my last messge here i dont want to use the space for a new issue... but i will tell you that i had to remove the recaptcha and not use it, for some reason, related to this or not, it just stopped working altogether, i could get it on reg but noplace else so i just got rid of it completly and started using the simple captcha (not the recaptcha) in the plugin list.. and that is working fine... thanks for the reply, and just to be clear, the fix on this posting title works great, thanks...  ok done lol
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.