
Dear Alex and Eliot;
After a long time of studying Links SQL with my modest knowlegde in Perl, Cgi, and DB I succeeded in building pages in two different languages simaltaneously. And from a user point of view, he can browse categorys in both languages. My next step which I work on is to enable searching in both languages.
I made some modifications, I added columns to category table as follows: Namea, Full_Namea, and Descriptiona for arabic categories that correspond to english ones. I duplicated some files to let the second copy read the arabic columns and build the arabic pages, these files are: page.cgi, add.cgi, modify.cgi, search.cgi, rate.cgi, user.cgi, subscribe.cgi, nph-build.cgi, Build.pm, and siteHTML.pm. And I added some subroutines in the category.pm and link.pm to deal with arabic info. Now my major problem is that I want to enable inserting the arabic category name from the admin area. I tried to make some changes in the category.pm as a sample please read the following:
sub disp_fatherid_form {
# -------------------------------------------------------------------
# Display the list of subcategories as either a drop down list of a text box.
#
my ($self, $col, $rec) = @_;
my $font = $self->{font};
my $out;
my $form_name = $self->{multiple} ? "$self->{multiple}-FatherID" : 'FatherID';
if ($CFG->{db_gen_category_list}) {
my $sth = $self->{db}->select ( ["DISTINCT Full_Name, ID"] );
my %names;
if ($sth) {
while (my ($name, $id) = $sth->fetchrow_array) {
$names{$id} = $name;
}
}
$names{0} = '--Root--';
my $select = $self->select ( { name => $form_name, values => \%names, blank => 1, sort => sub { lc $_[0] cmp lc $_[1] }, value => defined $rec->{FatherID} ? $rec->{FatherID} : "" });
$out = qq~
<tr><td valign=top><font $font>Subcategory of</font></td><td><font $font>$select<input type=hidden name="FatherID-opt" value="="></td></tr> ~;
my $sth = $self->{db}->select ( ["DISTINCT Full_Namea, ID"] );
my %names;
if ($sth) {
while (my ($name, $id) = $sth->fetchrow_array) {
$names{$id} = $name;
}
}
$names{0} = '--ÌÐÑ--';
my $select = $self->select ( { name => $form_name, values => \%names, blank => 1, sort => sub { lc $_[0] cmp lc $_[1] }, value => defined $rec->{FatherID} ? $rec->{FatherID} : "" });
$out = qq~
<tr><td valign=top><font $font>Subcategory of arabic</font></td><td><font $font>$select<input type=hidden name="FatherID-opt" value="0"></td></tr> ~;
}
Where Full_Namea is the arabic field. However, I foud that the final result I got the arabic category names in the same location in the page above the english names so I can see the final result which is the arabic categories. Could you please help me in making 2 table cells one hold the menu of english category list and the other for the arabic one.
Thank in advance.
wewe