XMS Profile Names

All new Coranto Addons, updates and patches to addons, will be released here...also, get support for addons within!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

XMS Profile Names

Postby jeter » Sun Oct 03, 2004 10:07 pm

How do I access the XMS profile name in a style?

I need to switch between two different link styles based on the XMS profile name.

Thanks.
jeter
 
Posts: 55
Joined: Thu Aug 15, 2002 4:35 pm

Postby InSAnE NiNjA » Mon Oct 04, 2004 11:40 am

this is not an answer, but it is a tip for who finds it..

<If: Field: xMultiSubmit == VAR>


is VAR possibly $ProfXMSCats{$xMultiSubmitSP} ?
..nuttier then a squirrel turd..
User avatar
InSAnE NiNjA
 
Posts: 1213
Joined: Sat Jan 25, 2003 6:35 am

Postby jeter » Mon Oct 04, 2004 11:53 am

I looked through crs_xmultisubmit.pl and found what i thought was the field and cobbled together this, but it didn't work correctly:

Code: Select all
<PerlCode>
if ($XMS_DB{$i}->{'Name'} = "Weblog Entry") {

   print "<h3><a name='<ItemAnchor>'></a><a href='/bin/log/log.pl?<Field: CustomField_uservar1>'><Field: Subject></a></h3>
   <p><Field: CustomField_newsdesc></p>";
}

else {

print "<h3><a name='<ItemAnchor>'></a><a href='/cgi-bin/dry/cms/viewnews.cgi?id=<Field: newsid>&style=article_view&tmpl=viewnews'><Field: Subject></a></h3><p><Field: CustomField_newsdesc></p>";

}
</PerlCode>


I stripped it down to this to see if it was returning a value and it seemed not:

Code: Select all
<PerlCode>

$xms_submitform = $XMS_Profs{'Name'};

   print $xms_submitform;
</PerlCode>


I'm probably missing something obvious.

Thanks for any help.
jeter
 
Posts: 55
Joined: Thu Aug 15, 2002 4:35 pm

Postby Parahead » Tue Oct 05, 2004 8:01 pm

Open up cra_xmultisubmit.pl and find the line that looks like this:
Code: Select all
my $BuildNews_Filtering = <<'END_CODE';

Just after that line, add this line:
Code: Select all
$XMS_Profile = $XMS_DB{$xMultiSubmitSP}->{'Name'};

Now you will be able to use <Field: XMS_Profile> in your style...

I will add this to the next release as discussed in this thread.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby jeter » Tue Oct 05, 2004 9:04 pm

ooooooooh!!!

thanks, para!!!
jeter
 
Posts: 55
Joined: Thu Aug 15, 2002 4:35 pm

Postby jeter » Fri Oct 15, 2004 10:52 pm

When I use this customization, it doesn't show up in a style that I use for display in search news. The new field shows up fine when used with a standard profile.

Why is this?

Thanks.
jeter
 
Posts: 55
Joined: Thu Aug 15, 2002 4:35 pm

Postby InSAnE NiNjA » Sat Oct 16, 2004 6:21 am

it was only added in, in the part of the addon that has to do with building..
..nuttier then a squirrel turd..
User avatar
InSAnE NiNjA
 
Posts: 1213
Joined: Sat Jan 25, 2003 6:35 am

Postby Parahead » Sat Oct 16, 2004 8:54 am

jeter wrote:When I use this customization, it doesn't show up in a style that I use for display in search news. The new field shows up fine when used with a standard profile.
Like Ninja is saying, it was only added into the XMS addon where the news are being built. I don´t use the searchnews addon myself, so I don´t know if it possible to update the XMS addon to do it for the searchnews styles as well. Depends on if there is a proper hook I guess... I could check it out. Maybe cerberos76 has some insight on the subject as well?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Art Vandelay » Sat Oct 15, 2005 7:31 pm

Sorry to bring this one back up, and it might be a little outdated, but I have the same problem, and this bug fix, does not fix it:

Parahead wrote:Open up cra_xmultisubmit.pl and find the line that looks like this:
Code: Select all
my $BuildNews_Filtering = <<'END_CODE';

Just after that line, add this line:
Code: Select all
$XMS_Profile = $XMS_DB{$xMultiSubmitSP}->{'Name'};

Now you will be able to use <Field: XMS_Profile> in your style...

I will add this to the next release as discussed in this thread.


I have the XMS latest release: 2.4.2

Might this have something to do with any of these two customizations I've done before?
http://coranto.org/forum/viewtopic.php? ... sc&start=0
and
http://coranto.org/forum/viewtopic.php? ... highlight=
My setup: Coranto 1.24
Addons: Backup (b2); Backup By E-Mail (1b); CorantoSQL (5.0 b18); Css Editor b (b1); CustomFields 0.8.6 (b21); EmptyProfile 0.6; Filter By Field 2 (2.1); Maginot (b15); Modify News: User Column b2; MoveIt! (a b1); Multipart 1.57 (b23); News Columns 1.0; Profile Copier (1.01 b2); Profile Numeric Filter 0.1.2 (b3); Snipper 1.0; Sort Orders (2.3); Special Links 1.0; Style Debugger 0.2; Template Editor 1.01; WebWriter 3.2; XMultiSubmit 2.4.2
Art Vandelay
 
Posts: 57
Joined: Fri Feb 09, 2007 6:14 pm

Postby Art Vandelay » Sun Oct 16, 2005 11:00 am

now something diferent happened

The style is now inserting the name of a XMS Profile wherever it finds the <Field: XMS_Profile>, but it is always the same profile. Event if the newsitem was submited through a diferent XMS Profile.

:(
My setup: Coranto 1.24
Addons: Backup (b2); Backup By E-Mail (1b); CorantoSQL (5.0 b18); Css Editor b (b1); CustomFields 0.8.6 (b21); EmptyProfile 0.6; Filter By Field 2 (2.1); Maginot (b15); Modify News: User Column b2; MoveIt! (a b1); Multipart 1.57 (b23); News Columns 1.0; Profile Copier (1.01 b2); Profile Numeric Filter 0.1.2 (b3); Snipper 1.0; Sort Orders (2.3); Special Links 1.0; Style Debugger 0.2; Template Editor 1.01; WebWriter 3.2; XMultiSubmit 2.4.2
Art Vandelay
 
Posts: 57
Joined: Fri Feb 09, 2007 6:14 pm

Postby Parahead » Sun Oct 16, 2005 1:59 pm

Art Vandelay wrote:now something diferent happened

The style is now inserting the name of a XMS Profile wherever it finds the <Field: XMS_Profile>, but it is always the same profile. Event if the newsitem was submited through a diferent XMS Profile.

:(
Are we talking about a problem in a normal style or a style used by the Searchnews addon?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Art Vandelay » Sun Oct 16, 2005 3:43 pm

Normal style, sorry.

I've also removed the customizations above, but nothing changed.

Am I missing something obvious?
My setup: Coranto 1.24
Addons: Backup (b2); Backup By E-Mail (1b); CorantoSQL (5.0 b18); Css Editor b (b1); CustomFields 0.8.6 (b21); EmptyProfile 0.6; Filter By Field 2 (2.1); Maginot (b15); Modify News: User Column b2; MoveIt! (a b1); Multipart 1.57 (b23); News Columns 1.0; Profile Copier (1.01 b2); Profile Numeric Filter 0.1.2 (b3); Snipper 1.0; Sort Orders (2.3); Special Links 1.0; Style Debugger 0.2; Template Editor 1.01; WebWriter 3.2; XMultiSubmit 2.4.2
Art Vandelay
 
Posts: 57
Joined: Fri Feb 09, 2007 6:14 pm

Postby Parahead » Sun Oct 16, 2005 4:00 pm

Art Vandelay wrote:Normal style, sorry.
I am guessing you have the sort order to something else than 'default' for the profile presenting this output, is that correct?

Do a search for the line below in XMS:
Code: Select all
$addon->hook('BuildNews_Filtering', \$BuildNews_Filtering);

and just after that line, insert this:
Code: Select all
$addon->hook('BuildNews_DifferentSortOrder', \$BuildNews_DifferentSortOrder);
my $BuildNews_DifferentSortOrder = <<'END_CODE';
# PARAHEAD: Now possible to use <Field: XMS_Profile> in a style used by a profile with different sort (2005-10-16)
 $XMS_Profile = $XMS_DB{$xMultiSubmitSP}->{'Name'};
END_CODE

This is not tested but hopefully it fixes the problem. Let me know and I will include this in the next XMS release...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

50/50

Postby Art Vandelay » Sun Oct 16, 2005 4:38 pm

You were correct by 50%, I was using a different sort order, in fact I was using the Sort Orders Addon, but your fix did not solve it.
So I selected the DEFAULT sort order, and it started to worked just OK. Wicth is fine now.

Although if you're willing to continue to debug this issue, please say something. I'm willing to help since I've already got the (real) scenario all built.
My setup: Coranto 1.24
Addons: Backup (b2); Backup By E-Mail (1b); CorantoSQL (5.0 b18); Css Editor b (b1); CustomFields 0.8.6 (b21); EmptyProfile 0.6; Filter By Field 2 (2.1); Maginot (b15); Modify News: User Column b2; MoveIt! (a b1); Multipart 1.57 (b23); News Columns 1.0; Profile Copier (1.01 b2); Profile Numeric Filter 0.1.2 (b3); Snipper 1.0; Sort Orders (2.3); Special Links 1.0; Style Debugger 0.2; Template Editor 1.01; WebWriter 3.2; XMultiSubmit 2.4.2
Art Vandelay
 
Posts: 57
Joined: Fri Feb 09, 2007 6:14 pm

Re: 50/50

Postby Parahead » Sun Oct 16, 2005 5:34 pm

Art Vandelay wrote:You were correct by 50%, I was using a different sort order, in fact I was using the Sort Orders Addon, but your fix did not solve it.
So I selected the DEFAULT sort order, and it started to worked just OK. Wicth is fine now.

Although if you're willing to continue to debug this issue, please say something. I'm willing to help since I've already got the (real) scenario all built.
Sorry, I made the code without checking to much, insert this piece of code instead (at the same place as before though):
Code: Select all
$addon->hook(BuildNews_Filtered', \$BuildNews_Filtered);
my $BuildNews_Filtered = <<'END_CODE';
# PARAHEAD: Now possible to use <Field: XMS_Profile> in a style used by a profile with different sort (2005-10-16)
 $XMS_Profile = $XMS_DB{$xMultiSubmitSP}->{'Name'};
END_CODE
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Next

Return to Addon Release and Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron