Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sun Zaza

Pages: 1 ... 4 5 6 7 [8] 9 10 11 12 ... 34
106
Programming / Re: if (!$zu_games_id) doesn't work. Any help please?
« on: November 28, 2009, 09:56:01 PM »
Thank you for your explination.

I already use your code in the global.php. Check this:

Code: [Select]
if (isset($HTTP_GET_VARS[URL_CAT_ID]) || isset($HTTP_POST_VARS[URL_CAT_ID])) {
  $cat_id = (isset($HTTP_POST_VARS[URL_CAT_ID])) ? intval($HTTP_POST_VARS[URL_CAT_ID]) : intval($HTTP_GET_VARS[URL_CAT_ID]);
}
else {
  $cat_id = 0;
}

if (isset($HTTP_GET_VARS[URL_IMAGE_ID]) || isset($HTTP_POST_VARS[URL_IMAGE_ID])) {
  $image_id = (isset($HTTP_POST_VARS[URL_IMAGE_ID])) ? intval($HTTP_POST_VARS[URL_IMAGE_ID]) : intval($HTTP_GET_VARS[URL_IMAGE_ID]);
}
else {
  $image_id = 0;
}

if (isset($HTTP_GET_VARS[URL_ZU_GAMES_ID]) || isset($HTTP_POST_VARS[URL_ZU_GAMES_ID])) {

  $zu_games_id = (isset($HTTP_POST_VARS[URL_ZU_GAMES_ID])) ? intval($HTTP_POST_VARS[URL_ZU_GAMES_ID]) : intval($HTTP_GET_VARS[URL_ZU_GAMES_ID]);
 
}
else {
  $zu_games_id = 0;
}

I really don't know what I have to do. I tried everything, but no luck.


107
Programming / Re: if (!$zu_games_id) doesn't work. Any help please?
« on: November 28, 2009, 09:32:42 PM »
Ok. I am defined hem in constants.php:
Code: [Select]
// URL Parameters
define('URL_IMAGE_ID', 'image_id');
define('URL_ZU_GAMES_ID', 'zu_games_id');

Is it ok?

108
Programming / Re: if (!$zu_games_id) doesn't work. Any help please?
« on: November 28, 2009, 09:21:32 PM »
Hi V@no. I am using the TODO plugin:
http://www.4homepages.de/forum/index.php?topic=19443.0

Is that what you mean?

109
Programming / if (!$zu_games_id) doesn't work. Any help please?
« on: November 28, 2009, 04:50:51 PM »
Hello,

On every 4images gallery, you can create an images_id, cat_id or user_id. Om my gallery I can create also games_id.
My question is:

On the page games.php I want to use this following code, but it doesn't word:
Code: [Select]
if (!$zu_games_id) {
    redirect("index.php");
}

That means if the user try to open a page which doesn't exist, he will be redirect to the homepage.
For example:

My last games_id on my gallery is 10 (games_id = 10). So if the user want to reach this following page, he will be send to the homepage:
www.mywebsite.com/games.php?games_id = 5000

The script does not understand what !$zu_games_id means.het is still giving a page without any infomation from the database.

Any help will be appreciated,

Cruxy

110
Thanks Rambrand & V@no.

The 2 solutions did not work for me. I used this one:

Code: [Select]
$zu_players_name[] = current($zu_players_row);
It works fine.

Thanks anyway for your help.
Cruxy

111
Hello,

I am trying to get some information from the database using the Dropdown option for custom database fields. It works almost, but because I am not a PHP programmer I need some support from you guys.

In the db_fields_definitions.php I use the following code:

Code: [Select]
$sql = "SELECT zu_players_name
             FROM ".ZU_PLAYERS_TABLE."
";
             $result = $site_db->query($sql);
while ($zu_players_row = $site_db->fetch_array($result)) {
     $zu_players_name = $zu_players_row['zu_players_name'];
         
}


And then I used $zu_players_name in this code:

Code: [Select]
$additional_zu_games_fields['zu_games__goals'] = array($lang['zu_games__goals'], "dropdown", 0, array($zu_players_name), 0, 0, 0, 0);

Almost there. The results is only the last name in the list. (Only 1 name)

I need some help to get all the names of the list.

Your help is appreciated,

Cruxy

112
Hello,

The dropdown option mod of V@no is one of the master works of him. I am using it many times on my gallery. Thanks V@no.

[MOD] Dropdown options for custom database fields
http://www.4homepages.de/forum/index.php?topic=7112.0


I want to start a new topic on purpose instead of on the same mod topic, because now we are going now to another level.

My question is:

How can we change the %dropdown_array% array to get information from the database?

$additional_user_fields['%column_name%'] = array("%field_description%", "%admin_field_type%", %is_required%, %dropdown_array% [, %is_multidimention%, %is_number%, %start_number%, %is_auto%]);

Code: [Select]
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("---", "male", "female"), 0, 1, 5, 0);

For example I want in the dropdown box all the usernames form the database.
Of course I can do it with another way, but I want to use the additional dropdown option.


Many thanks in advance,
Cruxy

113
Do not worry guys. I am using the same code for something else on my 4 images gallery. Instead of keywords I am getting images ids. So It was the easiest way to get the best help, otherwise it would cost me an hour to explain what I want.

Cheers,

114
Perfect Mawenzi. It is working!

I thank you very much for your help.

Cruxy

115
Hello,

How can I tweak the Keywoords code in the functions.php to give as results something like:

So if you have 3 keywords, it will show in the details page something like:
1, 2, 3

Instead of:

Barcelona, Madrid, Malaga

That means that for some reason I do not want to show the value of the keywords, but only the digits.


This is the code of functions.php:

Code: [Select]
  if (!empty($image_row['image_keywords'])) {
    $split_keywords = explode(" ", $image_row['image_keywords']);
    $keywords = "";
    $keywords_count = 0;
 
    foreach ($split_keywords as $key => $val) {
    $keywords_count++;
 
      $keywords .= (($keywords != "" ) ? ", " : "")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($val))."\">".format_text($val, 2)."</a>";
    }
  }
  else {
    $keywords = REPLACE_EMPTY;
  }

  if (!check_permission("auth_readcomment", $image_row['cat_id'])) {
    $image_row['image_allow_comments'] = 0;
  }

Many thanks in advance for you help,
Cruxy

116
Thanks mawenzi. I will give it a try.

117
Any suggestion please?

118
Does anyone has a suggestion for my question? Everything is possible with PHP, Am I mistaking?

119
Thanks for all your tips. I decided to not change the index.php to home.php. I found another solution.

Cruxy

120
Discussion & Troubleshooting / Re: Image_number = image_id + 1000
« on: October 15, 2009, 09:41:48 AM »
Thanks for your help. It is already done.
Cruxy

Pages: 1 ... 4 5 6 7 [8] 9 10 11 12 ... 34