Using PHP to identify the current page - by David Powers

Hi There,
I'm trying to write a script so I can identify the sub-pages under "Gallery" in my website
Under Gallery I have more than hundred pages describing the photos but I want to identify them as the "Gallery" page.
How do I achieve that?
It would be tedious to write the "PHP if" statement for each photo link.
I trust there is a simpler solution.
In PHP solutions by David Powers, Ch.4 "Using PHP to identify the current page"
The script is:
<?php $currentPage = basename($_SERVER['SCRIPT_NAME']); ?>
<ul id="nav">
  <li><a href="index.php" <?php if ($currentPage == 'index02.php') {echo 'id="here"';} ?>>Home</a></li>
  <li><a href="journal.php" <?php if ($currentPage == 'journal.php') {echo 'id="here"';} ?>>Journal</a></li>
  <li><a href="gallery.php" <?php if ($currentPage == 'gallery.php') {echo 'id="here"';} ?>>Gallery</a></li>
  <li><a href="contact.php" <?php if ($currentPage == 'contact.php') {echo 'id="here"';} ?>>Contact</a></li>
</ul>
Let's say that the gallery pages contains hundreds of links gallery like gallery/photos1.php, gallery/photos2.php, gallery/photos3.php, gallery/photos4.php, gallery/photos5.php, gallery/photos6.php, gallery/photos7.php etc...
How would I identify the sub-pages so when we are there Gallery is highlighted?
Thank you!
Best,

Hello Siddhardha,
To get the details of a process you need to use Locator class from BPEL api. You can locate your process by listInstances method which accepts WhereCondition parameter used to build a query on process instances. Once you've found the process you were looking for you can use getAuditTrail method to retrieve audit trail of a given instance. You can also use setStatus() method from a BPELX java exec tag within your process and later retrieve it from instance handle by getStatus method.
A sample snippet to retrieve instance handles to all child processes of a given process:
StringBuffer sb = new StringBuffer();
Locator locator = new Locator(domain,domainpassword);
WhereCondition wc = new WhereCondition();
String query = sb.append(SQLDefs.AL_ci_root_id).append(" = ? ").toString();
wc.append(query);
wc.setLong(1,parentInstance);
IInstanceHandle[] ih = locator.listInstances(wc);
You can read more about querying processes on http://blogs.oracle.com/matt/2006/06/27?print-friendly=true
Radoslaw

Similar Messages

  • Using Acrobat Reader activeX to get the current page views in a document

    Hello,
    I'm using the Acrobat Reader ActiveX control.
    How can I use this API (or any other way) to get the current page of the PDF document inside the Acrobat reader ActiveX control ?
    Thanks
    Ariel

    Aandi,
    I reckon that you might be right.
    But as side note, maybe Adobe will lose me and others as contributers for her PDF oriented solutions for other formats.
    In the long run experts can tell which approach is better: a .Net like approach (no limitations upon development issues for ) or this kind of an approach.
    Thank you very very much for you help!
    Ariel

  • I can only print the current page of downloaded pdf's.  Not able to print "all".  I'm using a Macbook air.

    I can only print the current page of downloaded pdf's.  Not able to print "all".  I'm using a Macbook air.

    it says "the document could not be printed".  "There were no ages selected to print".
    I selected "all".  I always tried selecting pages "1-3".
    The only choice that works is current page.  Very strange.

  • How can get all the components used on the current page

    how can I get list of all components being used on the current page using javascript. I have tried CQ.WCM.getComponentList(CQ.WCM.getPagePath()) but this seems to list all the components available.
    Environment CQ 5.5 Update 1, Widnows 7

    You have to remember that once you are in JS, you are only really able to retrieve markup or representations of the DOM.  The markup is the result of a combination of components, which is technically a "server only" concept.  Components are just a way for CQ to organize executable code, so once a page is rendered a component isn't really a thing.  The closest thing I can think of is to list all of the DIVs that represent a component wrapper that are on the page, but this is error prone and clunky.  You could also make AJAX calls back to the server to retrieve a list of the components by node name, but that approach would not return synthetic resources (ones that render, but do not have a node representing them).
    Why are you trying to do this?  Maybe someone has a better idea, but this has a bad smell to me.

  • I am trying to print all the PDF pages in a range of 5 pages but can only print one page at a time . . . It will print the current page, but not all or pages 1-5.  Can this be overcome?

    I am trying to print all the PDF pages in a range of 5 pages but can only print one page at a time . . . It will print the current page only, but not all or pages 1-5.  I need to go to the next subsequent page and command to print current page; continuing with this procedure until all pages are printed one at a time. Can this be overcome?

    You can use printPages(1, 5), however I need to know how you print current page.

  • How do I determine whether the current page in Forms is the last page.

    I have a requirement of printing amount in words using SPELL_AMOUNT Funtion Module, in SAP Scripts.
    When I have only one Item Line, I am able to successfully, print the amount.
    The moment i have line items pouring to the next page, I see that the I am unable to retrieve the spelled amount from the Function Module.
    I think may be i need to find out if the current page is the last page, and if it is so, print the amount on the last page, .i.e., the page where the item lines have overflowed to. How do i find this out.
    Can anybody, suggest something.
    Regards,
    Owais...

    I wonder if you could do something like this.  Wrap your logic with this IF statement.
    /: IF &PAGE& = &SAPSCRIPT-FORMPAGES&
    /: ENDIF
    Regards,
    Rich Heilman

  • How do I programmatically reference the current page in 902?

    Hello,
    How do I programmatically reference the current page in 902?
    The Portal Smart Text option for Current Page is not flexible enough, and I wish to create my own custom greeting using PL/SQL.
    Cheers,
    John

    hi,
    If you are developing a PLSQL Portlet, then you do have a way for getting the page URL.
    The page URL can be obtained from the record, portlet_runtime_record. There is a filed page_urlavailable with portlet_runtime_record.
    The portlet_runtime_record is passed as a argument to the show_portlet procedure.
    --Sriram                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Using body id= to highlight current page on nav bar

    Hi all, using the method of giving the body tag an id to set
    the current page on the nav bar, works all very well. however, this
    is no good if you are working from a template as it would mean the
    <body> being editable on each page (so most of the content
    then)....am I right? or am I missing something blindingly obvious
    here which will allow me to change the <body>...
    many thanks - didn't really want to use the javascript method
    you see!

    > Hi all, using the method of giving the body tag an id to
    set the current
    > page
    > on the nav bar, works all very well. however, this is no
    good if you are
    > working from a template as it would mean the
    <body> being editable on each
    > page
    > (so most of the content then)....am I right? or am I
    missing something
    > blindingly obvious here which will allow me to change
    the <body>...
    ideally, you wouldn't actually link the item on the menu of
    the page you are
    currently on. This is a usability/accessibility thing. If you
    do that, then
    you can simply style non-linked items on the menu differently
    to highlight
    that page.
    That said, it's often not a practical solution if you are
    using SSIs to load
    the menu.
    In that case, you could just add the Class to a wrapper DIV,
    or to the menu
    itself:
    <div id="myMenu" class="contactPage">
    <div id="myMenu" class="aboutPage">
    <div id="myMenu" class="productsPage">
    etc.
    OR, alternatively, give each meny item it's own class and
    then over-ride
    that one particular class style in the HEAD of each
    individual page. That
    said, I'm not sure how well the latter would work with DW
    templates.
    -Darrel

  • How to get the current page URL

    HI All
    I am working in oracle apps 4.0
    I have one page called history in that i have one page item called Application url. My application id is 122 but its a copy of application 106
    How to get the current page url for the page item.
    Any steps should be help ful
    Thanks & Regards
    Srikkanth.M

    I'm not 100% clear on what the requirement is from the description, however it does sound like you are making things unnecessarily complicated.
    If you want permanent/ID-independent links then use application and page aliases.
    so here we used to display the url like this: <tt>{noformat}http://81.131.254.171:8080/apex/f?p=122{noformat}</tt>
    Do you mean that the URL is displayed like that? If so that doesn't seem particularly helpful. How is anyone supposed to know what it is?
    There are many ways to provide links in APEX&mdash;including lists and nav bars.
    Where the link is to another resource located on the same server (such as another page in the same app, or a different app in the workspace), relative addressing can be used, making it unecessary to include scheme, domain and port information in the URL. For example, if the page to be linked to has a page alias <tt>ABOUT</tt> in an application with alias <tt>UNITY</tt>, and the apps share an authentication scheme/cookie to permit shared sessions, then the link URL is simply
    f?p=UNITY:ABOUT:&APP_SESSION.

  • How to get the function name/ID  of the current page

    HI,
    I searched the forum and google, but it is not clear on how to get the function name of the current page.
    I have 4 functions in my self service A ,B,C,D (seeded page links ) they all have to go to a page called hhhPG. Based on which function user is clicks I have to show the data in hhhPG.
    so my question is how to get the function name ? I mean I need to know if user click on link A , B, C or D link and came to this page.
    I found below in one forum and also there is getfunctionID in pageContext , but I do not know what to pass to getfunctionid("???") to get value.
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    Or is there a better way of know where user is coming from ? like geturl....
    Please help, I need this ASAP.
    Thank you.

    Use below to find out how the user came into the page
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    boolean isFunc1 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME1"));
    boolean isFunc2 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME2"));
    boolean isFunc3 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME3"));
    boolean isFunc4 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME4"));
    So one of them will be true based on the function the user came in.
    Write your logic based on these flags.
    Regards,
    Peddi.

  • How can I get the current user and the current page?

    Hi everyone
    Question..
    It is possible to get the current user (from the user's database on apex) and the current page? (I mean, if I'm in page 4 be able to query a variable / function or something which could give me the current displayed page)
    Thank you very much... I'd been researching without success :-S so I'll appreciate your help
    Regards,
    Fury

    Fury,
    If the user has authenticated, :APP_USER is the name that was used. The current page id is in :APP_PAGE_ID.
    Although I showed bind variable notation for those, & substitution format and v() notation are also available for referencing developer-defined items or built-in names. See the User's Guide for more details.
    Scott

  • [CS5.5] How to import a snippet into the current page

    Hi All,
    I got the IDOMElement from the document UIDRef and imported the snippet into it. Here's the code-
    InterfacePtr<IDOMElement> documentElement(docRef, UseDefaultIID());
    if (documentElement == NULL)
        break;
    if ((status = Utils<ISnippetImport>()->ImportFromStream(tStream, documentElement)) == kSuccess)
        //success
    ( tStream is the IPMStream of the snippet I'm importing)
    This code above is able to import the snippet successfully to the first page of the active document, but I want it to be imported in the current active page instead. So for this, I tried getting the IDOMElement from the current page's UIDRef instead (logically I thought that this will import the snippet to the current page)-
    InterfacePtr<IDOMElement> documentElement(currentPageUIDRef, UseDefaultIID());
    But the result is just the same— the documentElement is not null, but the snippet is imported to the first page only.
    May be that the concept of IDOMElement is not clear to me, but I cant find any documentation of it in the SDK guides too. Can anyone explain to me what's an IDOMElement and how can I import a snippet to the current page?
    Any help will be highly appreciated. Thanks.

    @mfreitag, thanks a lot for your reply.
    I havent tried it yet, will let you know after I try it- but I want to ask that how will that help me placing elements to the page?   Can you please elaborate a bit.
    Actually in CS3, I used to follow this implementation to place the snippet into the current page-
    1. Create a dummy textframe in the current page (needed just to create a group).
    2. Create a Group using that dummy frame.
    3. Get the IDOMElement of the UIDRef of that group-
       InterfacePtr<IDOMElement> documentElement(groupUIDRef, UseDefaultIID());
    4. Import snippet to this DOM Element
    5. Delete the dummy frame
    The snippet items were added into the group beautifully in the active page. But when I was porting the plugin to CS5.5, steps after step-3 failed, and the snippet is imported to the 1st page/spread of the document.
    I'm not sure, but seems that things related to IDomElement are changed for CS3+. May be you have an idea whether I could use the similar implementation to get this thing work?

  • How to you reference the current page number and total pages in a script?

    I'm trying write a small script to make field invisible when the current page equals the total number of pages, but with no luck.
    Can anyone advise how to do this?
    I've tried various ways to reference my fields, this being the most basic:
    if(pageNumber == totalPages) {
    continuedBase.presence = "invisible";
    // pageNumber has a run time property as "Current Page Number"
    // totalPages has a run time property as "Number of Pages"
    // continuedBase is a text field within the same subform as pageNumber and totalPages
    Thanks for any help offered.
    Russell

    If you are asking how to get the current page and total pages you acn use these commands:
    current page ----- xfa.layout.page(this)
    total pages ------ xfa.layout.pageCount()
    so your code woudl look like this:
    app.alert("The curent page is: " + xfa.layout.page(this));
    app.aler("The total number of pages is: " + xfa.layout.pageCount());
    if(xfa.layout.page(this) == xfa.layout.pageCount()) {
    continuedBase.presence = "invisible";

  • In version 8 the "stop loading the current page" icon is missing. How do I get it back?

    I just installed version 8, and even though the features page says that the "stop loading the current page" will be a part of the default navigation toolbar, that icon is not on the toolbar. How do I get it to be there

    In Firefox 4 and newer versions, the Go, Stop and Reload buttons are combined in one button at the right end of the URL or Address bar. The button changes depending on the activity:
    *green Go arrow when typing in the address bar
    *red Stop ("X") button while page is loading
    *gray Reload (circular arrow) when page is finished loading.
    See image at the bottom of this reply
    Separate buttons are possible:
    #Open Customize Toolbar window by clicking Firefox button > Option > Toolbar Layout '''''OR''''' clicking View > Toolbars > Customize if using the Menu Bar '''''OR''''' right-click in an empty space on a toolbar and choose Customize
    #<u>While the Customize window is open</u>, Stop and Reload buttons will show separated between the address bar and the search bar
    #<u>While the Customize window is open</u>, drag the buttons anywhere on the Navigation toolbar
    #*order Reload-Stop will combine into one button
    #**leaving in this order between URL/Location/Address bar and Search bar will cause it to re-combine with the "Go" button at the right end of the URL/Location/Address bar
    #**leaving in this order elsewhere, the Reload and Stop buttons will combine into one button
    #*order Stop-Reload will remain separate buttons
    #*or drag a "Separator" from the Customize window between Reload-Stop and they will remain separate
    #click Done at bottom right of Customize window to finish
    See: https://support.mozilla.com/en-US/kb/how-do-i-customize-toolbars
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Back button doesn't work due to multiple history entries for the current page. How can I fix this problem?

    This problem started February 2015. I have noticed it mostly while searching ebay. When I hit the back button it did not work. I right clicked the back button and found at least 2 and sometimes up to a dozen duplicate history entries for the current page I am on, meaning I would have to click the back button a dozen times to get to the previous page. I am using Firefox 35.0.1 on a Vista computer. I have not found any fix for the problem after searching the internet for hours. I have seen similar issues with people using IE and some say the duplicate entries are caused by banner ads but still no one has provided a good answer or fix for the problem. Please help.

    I will leave further answers to users of ebay. Script or adblockers may ease the problem.
    * Try this add-on search [https://addons.mozilla.org/en-US/firefox/search/?q=blocker&platform=windows&appver=35.0&sort=users blocker] (Windows)

Maybe you are looking for

  • How do I know if the music I buy is original or re-mix?

    I want to buy some songs by Whitney Houston.  How will I know if I am buying an orignal or a re-mix?

  • Firefox crashing issues

    Every time I open Firefox, it crashes and it's very inconvenient. I have to restart 3 times, then the 4th time, I'm forced to go into Safe Mode for it to work. Thank You, Adam

  • Outlook calendar to iCal

    I use a PC at work with Outlook, and would like to import my calendar to iCal at home...How do i do this? Any help is appreciated. Thanks.

  • An artist has more than one album.

    I have a Katy Perry album and it shows that she has 2 albums on my iTunes but there is really one. And also, I have a "Various Arist" selection that says that there are 6 albums when it really shows only 4. How do I fix this???

  • EEM and TCL Interface

    Hi. I need help. How to implementation EEM. I want use EEM this situation. If the syslogmessage "Interface.., changed state to down" comes than the Router should Reload. IOS 12.4(15)T8/T12 Sry for my bad english