|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////9 n1 b4 S* L! l- F6 @* M
// Theme Option
! m0 }+ {5 k5 z4 a! J9 x) o9 \////////////////////////////////////////////////////////////////////////////////
5 e1 X4 i8 X" s8 S" S
! ? ~( g2 R r% y$themename = "Zenx";8 e6 v1 K. Z+ D# u3 D' a
$shortname = str_replace(' ', '_', strtolower($themename));. M& ? F% o: h; P, t% M g8 R
6 k8 v; i3 K7 z
function get_theme_option($option), @5 V& ]7 N% D2 }
{* r2 o3 D4 O) B" @ A# }9 \
global $shortname;
. s* k' l: W! E; z( a7 X return stripslashes(get_option($shortname . '_' . $option));0 m9 C* |& X% d; A
}
( X$ Z q8 I, C8 T3 Y( r1 r- B+ _, L
8 m# h! d% \9 D; ~- U4 Yfunction get_theme_settings($option)
+ K: v( ?- F l* o{1 h" k* ^8 B; x9 E+ P; e& y1 X
return stripslashes(get_option($option));" O! h, D1 P5 z7 H: w
}# e3 ?" S/ G' v) x% a4 G9 \" n% P
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");0 E3 _% J! e! O* q. m' ?
$wp_getcat = array();* o- V0 A0 Q" e( \( ]
foreach ($wp_dropdown_rd_admin as $category_list) {) [ X- {6 d7 j3 p
$wp_getcat[$category_list->term_id] = $category_list->name;
* l: R" Z+ W0 R: P2 G S}
: u; ^" x' m; V% } t/ y$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");6 _) W) b: d& ?7 ?, E
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");' o3 t# l& r A, ~' T5 b" \4 R
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright"); s- P. d# j" }3 _6 N N
4 u! L$ s1 @* I% T$ s( P$options = array (
( Y. d8 l* V# Y: U! F
6 W9 a( i d7 m' e2 I7 E
s/ |7 F+ O* p; P V array( "name" => "Blog Header Settings",! b% _4 t- ]; l
"type" => "heading",8 ^- z, O. O, W
),
. ?, V5 l/ b2 S; f3 S8 r
* T) p; W- N b. @1 M array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
6 P4 z' W# D4 E Y! K; m. _& Y* g "id" => $shortname."_header_logo_activate",
, P1 k0 L& I2 G "type" => "select",2 n% _ I# j% H- D& G: h% i" D) L3 f
"std" => "No",
) H! R* [$ a! V8 @, ~7 h: ~" l" Z1 } "options" => array("No", "Yes")),; f! Q$ P: y- m! z7 P; b
) H3 [* S& d) t; ?1 ^8 u3 Z
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
, c9 a& \) d. H8 g "id" => $shortname."_logo_url",
! u5 w4 z4 }- F+ _3 x$ G* Y "type" => "text",
& o" {' ^% W( R% R "box" => "social",
8 [0 R" s- U4 S; e "std" => "",
8 `0 h# O+ ?; l ),9 r4 L+ I. ]0 V
8 C2 w# ^( r1 K# n: U9 j+ W
array( "name" => "Insert Header Banner HTML Code (Header)
* |" p) _* W; y' Q' g4 x O/ O <br /><em>*Recommended Size 468 x 60</em>
, d1 A* ~. Z+ \1 t# Z9 u <br /><em>*leave blank if not use</em>",5 Z. R( @9 K8 r1 x0 }1 j& Y f& a
"id" => $shortname."_header_banner",
4 j" Z7 b- e: {; ?2 z6 s$ \ "type" => "textarea",
7 y8 q# {/ o; H F% B "std" => "",
$ W1 _ i4 Y, p( \! V ),7 |! t! G& F; q6 c
; Y- B: V8 h4 _9 D- k8 _2 d array( "name" => "</div></div>",1 C' @7 z6 g# @/ v/ y
"type" => "close",
6 W) n( p E( U1 M4 n- l ),, C2 t0 D6 X, P2 X! n) Y
" s# w; T, f8 S1 q0 i$ L7 o9 K& z' F' `. w. b3 `* f
array( "name" => "Header Navigation Settings",; Z+ h, V8 A4 C; ]$ a9 m; C
"type" => "heading",
. X1 r1 c. ]: H! r2 ^6 g+ u ),3 Q5 Q4 B4 A; z
* s3 f0 D5 Z. y, g. m
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
$ m" R% J: _/ V: H <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />3 l4 q/ [- {+ }- h% T3 M
<em>*Enter the page post ID number only</em><br />5 I( ]5 N- C7 i% f3 ]& [# y
<em>*separate by comma</em><br />
+ S, A2 f7 F. T9 o <em>*Exclude pages which you don't want to show on the header navigation</em>",
' }$ n- }# E n0 d3 X "id" => $shortname."_header_page_navigation",
9 q0 I0 o: k5 U7 g- }: U "type" => "text",
" w7 k- Q- _% a, m" D, a "std" => "", p6 V, W. [' j0 i0 k
),
" d" G8 L9 c8 @# D2 f8 i: Y
. ?. ~8 v9 f- S2 @# T6 ~ array( "name" => "</div></div>",
- } o/ S5 ^* r0 K+ @9 ]1 e "type" => "close",8 M1 f+ c9 @1 t! n; s$ v, G0 A0 p$ P
),( @" F- ]7 ^9 k+ M1 j- U5 W! H# i2 _
. _: ]1 C; K$ B2 K/ F E1 s' d/ }( W
, N% f3 S1 y- J8 b: M! ~+ }& i array( "name" => "Post Auto Thumbnails Settings",$ Y" h3 A6 z. d
"type" => "heading",5 _9 t& c; ^- K4 l/ V9 E
),' H1 N6 M% V3 M: u x2 g$ \
\8 D; ~. @! d" i
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- g* d% l$ n( b8 O# M* p7 s "id" => $shortname."_timthumb_activate",
' H9 v) j+ P( D "type" => "select",) }9 z' m. h; j9 ]8 X
"std" => "No",/ v7 f1 r C$ z, w, @
"options" => array("No", "Yes")),
! ^8 a- K# J1 i
: B" m; c! _$ _- k; ~ array( "name" => "If Timthumb is enabled, Please choose its cropping method",9 h/ C& @$ N7 g+ V* m9 y! M: q
"id" => $shortname."_timthumb_cropping",
6 J2 X* C; I+ } S "type" => "select",
' M3 a2 E& B& N! ^6 }% C M "std" => "",
) v0 i9 X2 M9 h" ~4 V' c2 o/ [, ^$ B "options" => $crop_position),
0 U: y, V, Z* p0 i/ |. d+ c/ q) Q1 I2 }
array( "name" => "Insert Width Of Thumbnail Image<br />( l* O8 N) r3 ?
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br /># \/ ?" H' p2 J' f
<em>*Leave Blank To Use Default: 250</em><br />",
& D& q) [+ ?6 Z# A, C/ w "id" => $shortname."_thumb_width",
) V4 \7 o g: H6 c9 z, J- c/ W "type" => "text",) c# X+ y2 I1 ~/ }& _! |+ m
"std" => "",4 {. V* z# ^5 l* D, M
),' I) D y8 z6 u* v- m' u6 M
`! a r6 s! ?$ K- D- Y+ G
array( "name" => "Insert Height Of Thumbnail Image<br />
, V! S" K- n5 T# p# Z <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />& u1 D: m* X. \5 a* f
<em>*Leave Blank To Use Default: 200</em><br />",
( ?, w- Y. d) `/ q# ?. h+ r "id" => $shortname."_thumb_height",
! o9 i( m4 |$ G7 e" @ p "type" => "text",- c0 Z/ U8 Q9 ?/ Q5 J5 u
"std" => "",. K# }' ?) B9 Y. _
),
; _7 S7 s Z3 B( ^
7 ~- g1 K1 U5 n6 h) b array( "name" => "</div></div>",
: }6 Q9 q' }# j, ?8 ?0 F2 L "type" => "close",& F) m9 G/ [$ r2 l2 Z8 V- B; \
),* ]8 p( U7 }) g9 r
5 N. S( \3 s, k
array( "name" => "Featured Content Slider Settings",5 G: |0 z1 `4 y7 x" _3 u/ R
"type" => "heading",' Q9 w. U- t) _" W3 U, \' B2 i
),* d* z( `# a! c' @- `; O
+ K' M' c0 v8 b" V0 }
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" T4 B3 s$ m+ @0 `3 @ "id" => $shortname."_featured_activate",
& A" ~$ a5 }+ y "type" => "select",
& Q' ^6 j0 p- A: f "std" => "No",
% A8 V4 Y1 }2 w) | "options" => array("No", "Yes"))," Q" x! B* m/ R7 K6 |5 Z
/ r) D& @/ b1 v" D
( e( U8 `1 |$ v) n E array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",+ i; G3 O! N' Z; t: {" \
"id" => $shortname."_featured_category",
% l5 E2 H; c0 W2 j' @5 B- O "type" => "select",
/ P# m' ~3 a$ S! t( ~& Z( h9 i d "std" => "Choose a category:",
1 w |8 C6 \0 {7 ]+ h "options" => $wp_getcat),
9 ~& R3 O7 @2 G- V, U
- x' S1 |0 a, G! A& n array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",& C" S A, k, ]; l6 X* u
"id" => $shortname."_featured_number",2 n, i2 Q/ O& V, e9 f% j
"type" => "select",
& e& z) ^# U7 x/ d- {9 i9 ]$ t3 n "std" => "Number of post:",! M3 X( b6 e; p. q) \/ L
"options" => $number_entries),) w" N" O% m0 k. d% {3 z
J2 a, }: D7 B f; T array( "name" => "</div></div>",
8 j+ g1 ^1 n" B- i; N9 a3 [; ` "type" => "close",8 B2 I; o# ]% _0 K D# R
),
6 E) ^& q* M3 j( Z( [- N6 R, n, ]
% @1 ]" X, P3 { array( "name" => "Featured Category Settings",
8 r* I* v: `5 A" y "type" => "heading",* ^1 f) T& Q6 y
),9 [" F$ _2 p/ z4 U N7 t ~4 j9 L5 W
B# J+ f5 v$ k array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",( P, @2 Q3 [; i( y
"id" => $shortname."_featured_category_activate",
/ [0 W; Y+ e& ?! j) ~* @' ] "type" => "select",- n) o, i# B: d8 r% E
"std" => "No",
7 ^; j0 g' a2 w( | "options" => array("No", "Yes")),
: p+ @) X: E" `) d4 m
" c( I8 r+ v" _8 j, t8 q array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",/ j. [# F, k( p" X) k4 Q
"id" => $shortname."_featured_category_id1",
( g( `! v: G% I: L6 F5 T) N8 ~+ H "type" => "select"," Y& c8 D2 Z: H6 B
"std" => "Choose a category:",
7 E7 j0 B& L) g# F "options" => $wp_getcat),: o: i2 L" x; O! u" M8 L/ n
! m4 w& @& V0 h) Y/ g. U
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",: S, m5 S/ h& e; N, m* ?
"id" => $shortname."_featured_number1",% \+ }* f' q% u8 K3 ]3 ~$ U
"type" => "select",9 [! a8 e( z# x/ `9 l: u
"std" => "Number of post:",
( g8 ], R5 Y% R. T; f2 O( | "options" => $number_entries),
! c9 P0 |' G6 A- d, L
# k* g7 F. r7 V- a: C/ a7 u array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
6 v6 y( ?! w$ D7 O: \6 d8 }- W "id" => $shortname."_featured_category_id2",
$ x8 v& q/ q( Q$ B "type" => "select",' P$ k/ ^. }7 _8 k- l: C& a
"std" => "Choose a category:", b+ S& A; \# P" j- V6 S/ M+ l2 V
"options" => $wp_getcat),! n; \1 x& [6 D% z
$ W" z* A1 S% i& h" r2 ^4 D, x U! m& p array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>"," v& X4 I% g# r+ [% M, l
"id" => $shortname."_featured_number2",
' q0 x; k5 d* @6 l$ n "type" => "select",
* Z" D, h1 T" `: o& E. c "std" => "Number of post:",
; j( F1 p2 @; R% l4 Y "options" => $number_entries),* Z8 b" ~4 R; P
; L _+ I; z. X! C( h
2 d6 w# N" {; v, W* j. m4 y+ w+ K array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
T/ {6 U* w3 } "id" => $shortname."_featured_category_id3",- L; B6 n( v% P; ~' U+ F
"type" => "select",
% s% d* P1 M! u+ L "std" => "Choose a category:",# m* p* f* _: e
"options" => $wp_getcat),% |8 t$ m9 y K8 L
, T4 n3 I& ]$ i) t3 y5 T
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>"," e. d6 J2 `0 t+ ]8 I6 L. i. s
"id" => $shortname."_featured_number3",
2 b( a5 W" T. e" m "type" => "select",
; G( Z4 @& z. T "std" => "Number of post:",
7 |; A( I- O& J( @ "options" => $number_entries),
1 x6 E V |1 d+ Q* |% D& M! \$ u- U Y8 I
& r0 [: e, c+ n
array( "name" => "</div></div>",8 \, H: x" [! ]5 T$ B& C1 i- w
"type" => "close",) K7 z. R) W* Q& w4 F
),
. j' x0 f3 ^8 v9 q h. f6 f9 A. | W$ A$ a; ]
. O7 A% D9 l) h2 m
array( "name" => "Google Adsense & Analytics Settings"," e, ^* \- |) r- @$ _
"type" => "heading",
6 G( b! T) j, V$ h1 C( N+ m ),
% X/ K& b( X1 u* e, L3 q$ C. B( x5 l1 M1 Y ?- R+ L! k: B c
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",/ V! w7 T! y! {1 i7 O" T
"id" => $shortname."_adsense_loop_activate",
- X0 M$ D6 f( ]* e. I/ q "type" => "select",
3 u! S( G7 H' l' g& Y, r- w "std" => "Disable",
* A& T8 O# V3 B "options" => array("Disable", "Enable")),& Q" S2 n! T; T( n! S% C
% Y4 U" B$ W! |* w& J5 f array( "name" => "Insert Google Adsense Code For Loops Here<br />
) I9 Z1 I, P5 a% b* ~) j <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
* I% Y5 s2 L5 L& a4 E "id" => $shortname."_adsense_loop",
1 R; @7 J ?, {: R "type" => "textarea",4 M- d+ n, k( p' r( S/ X
"std" => "",
. q+ A* I* P) }3 Q ),
% L" |" X4 r, i) E1 \9 w3 S; l# n7 Z( ]0 U
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",) g# B2 e3 t5 W- J2 l$ X
"id" => $shortname."_adsense_single_activate",
2 x5 h1 |, O6 J/ c: K. X! B/ v% y "type" => "select",
0 N* N. O' `( [1 J8 c% X3 ?7 i% q& ~ "std" => "Disable",1 I1 {5 s& u2 {3 J! W
"options" => array("Disable", "Enable")),; u+ @- y$ D0 \; R3 `
$ s) c9 M B/ X% H array( "name" => "Insert Google Adsense Code For Single Page Here<br />+ v4 c8 T& ^* C3 p0 O
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",7 f8 }, ]; K% n9 ^ |4 k3 O+ X
"id" => $shortname."_adsense_single",
' @$ R' P: W+ B% x" U7 m( i "type" => "textarea",+ B6 \0 Y! E- L; J5 b! b( E
"std" => "",( M3 @7 @9 h% `
),3 D1 {. C" [4 E( o& n& o
+ h( C: a" M, Z2 w' p
1 ?' `: M2 c" Y1 ]3 o array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
2 k' R/ V$ z' K& O "id" => $shortname."_google_analytics",! x1 U4 U$ W8 Y' j9 Z* W" q
"type" => "textarea",
, m4 b0 N, a0 m; k# ?/ M1 A3 | "std" => "",# \% d' ?# h! P" y6 }( t
),0 x; [2 M& L6 e: U" t' Q7 k
$ @+ f4 q |; W array( "name" => "</div></div>",4 |2 O$ J/ j. d' I
"type" => "close",
- g2 x1 J* u* y1 k" N ),
+ j2 a7 W0 J5 f$ T& \5 x4 B
" _0 x* K" H8 g W4 Z . T( _$ v$ B* o1 a2 |; Z; R
array( "name" => "AddThis Social Bookmarking Settings",
- l! R0 `5 ~; [% N6 Z9 N: c( E; O! i "type" => "heading",
, N& }5 V( L* p" j" X ),6 i" u! N( u0 e W$ z" y4 C
- a# T$ v- h# z( H! Y. M array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
/ I ?* L9 G8 B0 j! W/ Y C <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",: T+ Q; P* q* Z2 }2 S
"id" => $shortname."_addthis",
. t9 d: r2 i5 }/ q5 v; [4 O) I* ]2 ^ "type" => "text",
" \) E) S- X) J* I5 e- o "box" => "social",
6 {( \2 U6 T+ |( ]: E "std" => "",4 |- j: n0 O% f
),
: g1 m/ B: ^1 ?* g- Q- r5 W$ [. `
0 ~( U( i/ c/ u1 {' S' D array( "name" => "</div></div>",
& U9 B& e0 o0 ^$ r% Z8 U0 @& F "type" => "close",5 d: t: h/ {9 X
),. A! Y4 q) p7 A- P1 E% O' ~1 m
2 ^' I8 A# a. c+ Q' B+ u! s
1 s& _. K/ I: I' D
; n% F9 ^3 ` [; X5 W/ f1 E array( "name" => "YouTube Video Settings",
) {' ?. l/ c( v" n "type" => "heading",
% A: r" ]. T' r: k ),
9 K( }5 `0 Z2 E) ^. s' {% w& Q$ z. Q5 Z! F' Z" t
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
- m/ G$ k7 T8 b: _ e' a "id" => $shortname."_emvideo_activate",! N. i1 S( r+ J' u3 E& S
"type" => "select",7 ^5 @4 H1 N l
"std" => "No",( K. [5 H( I9 S5 O k! I
"options" => array("No", "Yes")),. ^+ V1 V5 J1 z8 m2 j& ^
# {) ^( v9 O% ?( | array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
9 k3 H+ X1 a3 P" v3 z" w "id" => $shortname."_emvideo",& o; V7 v# P2 h# _! p% |
"std" => "",' E* l- [( d* _* \" ^
"type" => "text"),* g: E t# ?* j6 o0 X8 |% s
8 F; ?2 y3 x7 U3 y
array( "name" => "</div></div>",
( v; _, y, a& U6 a% B3 ] "type" => "close",, Z0 j1 E9 ]+ v7 _
),
" P+ V' Z% _. W2 n7 {; S' S# s" K
) K% x; S5 t- X' K# G1 V- I array( "name" => "Twitter Settings",
$ D, V; y3 Q. M0 q "type" => "heading",0 M0 Q$ j& C" X" v7 N2 [
),( F& M, V L9 ?. L
! v( n2 h K7 z+ i array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! K1 F& Q' A8 h- u' c8 R "id" => $shortname."_twitter_activate",
: p9 S u0 z$ F- S1 G "type" => "select",
: X- G* s, T5 Q8 C* j! V "std" => "No",# ?6 c! s- C& t0 [5 r
"options" => array("No", "Yes")),
2 G6 V1 v6 e2 N- g q
! n" {0 n% x* C3 b array( "name" => "Insert Your Twitter ID here
* C+ Q$ L) e' h: ^ <br /><em>*leave blank if not necessary</em>
( R9 s# S+ a; w; [2 X& \ <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",6 n6 r% U9 C, o* \
"id" => $shortname."_twitter",' Q0 L/ r4 U" d
"type" => "text",$ B0 f1 b6 a4 @2 y* R, P
"box" => "social",, A- C$ ^9 F* O9 f. i
"std" => "",
9 ~- ^" a' i% Y+ d+ x% H ),
3 ~1 l6 v8 \0 k" J8 _5 l. F( U9 \ L/ X# j2 ?0 N8 N4 U. S
array( "name" => "Enter Twitter Feed Count here
! D# E7 b w4 @, p6 S5 T/ _ <br /><em>*leave blank if not necessary</em>1 l2 F% y5 N6 q; }
<br /><em>*Enter How Many Twitter Feed To Display</em>",$ f7 r6 [! Q7 |7 {& h. z& o
"id" => $shortname."_twitter_count",- S& Y9 E& {& ?7 R: A
"type" => "text",& s. q$ }) w7 F* {$ j
"box" => "social",$ y2 l1 R3 Y# Z6 r$ F
"std" => ""," e- m2 F% V5 S5 e
),7 t/ Y6 }# B! W2 Z: Z
! `! u6 T. C7 C e; C
array( "name" => "</div></div>",
+ ?* t1 N) K. V, ^ "type" => "close",
3 q1 L+ m; U6 P0 B4 i ),+ u2 V4 S7 V' ]( ?( C& c" V
* y4 n5 T& ?2 m) n8 ]* @
, g2 ~' w4 s; x1 W0 m% x array( "name" => "125 x 125 Banners Advertisement Settings",8 R) ^; i) F! |6 {$ [: ?+ V
"type" => "heading",3 k8 O7 `$ \2 Y
),
0 z7 i& Y' h: A5 R/ |1 j% Q" U
4 R: _2 M% ?9 [7 ]8 t array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
. a8 G. x$ H& m9 `9 \# z "id" => $shortname."_sponsor_activate",
/ H E! j! ~$ z; J5 O" { "type" => "select",
' t2 s. H! U7 c "std" => "No",
* s% }" T; ^; Q L+ G! w "options" => array("No", "Yes")),
* Y' L$ c6 x+ }2 H
% L, _3 [9 W; G3 p; G/ W6 _3 M
" i+ Y. z/ u0 z/ f9 x7 O array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
- a- y! K R: x- D) T6 H! @ "id" => $shortname."_sponsor_banner_one",; t% w" b, l2 U/ q5 K+ `
"type" => "textarea",
+ g- V/ J# I4 }1 m7 f$ i "std" => "",
# b7 u* h3 O3 N1 l* Z0 H8 j# q) t ), , P) X, G1 o2 X7 e
+ o% B, S) e/ b/ u$ D+ ^/ X
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",% ^' u' p: ?) g0 I
"id" => $shortname."_sponsor_banner_two",0 |+ j% ~ j" E$ H {
"type" => "textarea",% _4 t6 p4 g1 ]
"std" => "",
0 F# L$ p j# G6 P) v5 }% k3 {. b ),
8 a& u- |8 n- ? E# p
0 s& N, z# f$ E3 L& }) K3 p array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
7 X. y9 u# b2 J& r0 q1 | "id" => $shortname."_sponsor_banner_three",' E! C4 j7 D' N; ?, A$ g; ^- w Y- ~
"type" => "textarea",6 D8 j! f+ k8 q
"std" => "",
1 W" H% x; W1 J ),* X1 a: D% \3 f3 E
0 Q0 h. b8 J& Z$ {: Y array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",) K4 c' ^/ L7 `
"id" => $shortname."_sponsor_banner_four",
% f6 }% X, x3 }' A! o" h "type" => "textarea",
1 X8 V& G/ R( |' V6 C1 ^3 I& q "std" => "",+ k3 A; ^2 r, \
),% \4 P- |/ ^" c1 Y: v7 B& Z
- x. f& m- M4 Y, p+ k0 q, _ array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",; d2 Z& z/ J+ C6 l0 F% V
"id" => $shortname."_sponsor_banner_five",' ^' ^# u& d, o \/ I8 G- J+ }) g
"type" => "textarea",
+ I6 j& [, w2 G8 s6 f "std" => "",% l3 i& D: i: c8 S; Y0 r* G
),9 U8 l0 v9 z7 U/ B D4 m
+ d( U [* E4 w2 X array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",6 ]9 z- k0 \4 ?+ B: e
"id" => $shortname."_sponsor_banner_six",
, c9 E% a9 C, t( K' @% | "type" => "textarea",$ A7 r. L- k" R4 S9 x
"std" => "",* Y7 C' C9 R: C$ T2 T) n$ X1 d5 L
),* I& R5 Z5 h9 j6 R! e5 r
7 ~7 v$ D" N+ ], e: k( {, _1 [ array( "name" => "</div></div>",7 `# V+ p. `0 s' ]9 p
"type" => "close",& Z n' ]* h% }4 U( k- {
),7 w1 {+ b, ]. ^1 O& q
% B6 A9 E0 t0 P+ T: I* x
7 H: c1 K% x5 {5 c
. \( i6 {6 n& i B3 Q, g);$ o$ |7 j3 E& R
7 w) N/ Q6 Y9 r& Z$ dfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {6 s3 s: {3 p* D
) \& `4 g: Q; ` Lecho "<div id=\"admin-options\"> ";0 e$ h, ?( }8 f& y! ]
( k7 V' o! X, w) K* n; P
global $themename, $shortname, $options;
1 K4 p! H* w; v/ B! z5 Qif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';( c+ a& H4 c: i6 x/ D
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';7 i3 Y* t' W$ H
?>
8 A1 h6 Z3 @$ W8 |$ j1 F+ b# s! T A$ h5 g' l4 d$ D% L7 o
<h4><?php echo "$themename"; ?> Theme Options</h4>. k5 O- R/ R+ ~2 V
) b. t5 Y. E& s4 ^) J; _) B" Y<div class="annouce">% V/ h/ x- f, F# `1 u+ E% N
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
$ a! ^9 \0 d# i# q<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>4 F2 [. _: v2 Q. t; f; U; T% E+ `8 y
</div>
; s) ^& |8 m6 d0 E8 K. z b4 Q6 W* ~' i) ]9 o. U0 }/ K# r q
<form action="" method="post">
v' c( j! {% K$ H
5 D% b4 ]5 E% Y# H6 ~$ c5 Y8 {2 X5 }<?php foreach ($options as $value) { ?>. u9 \* c) h2 M2 y8 V' k* w7 _9 H
' o' s5 }: @' `* y, ]1 b
<?php switch ( $value['type'] ) { case 'heading': ?>9 N% y7 a/ a7 Z3 t
- ]# k7 e; T' |. h- N1 F
<div class="get-option">
7 O# y q1 j) ~; Y# r
0 [0 L" e8 i6 K k<h2><?php echo $value['name']; ?></h2>' J, o( l9 T5 D6 J7 h( X
, Y% `0 ]& }" Z<div class="option-save">
' ^; x; l" u; y/ }. X2 y- c
4 @$ w6 O) ]* X" Y; U* @( [<?php# ]2 o, _; m8 Z% \: @! t
break;1 W1 x* U8 s1 C) Z1 @7 k, X
case 'text':
9 C* v+ j% G9 I; n! Y$ j?>. b# T4 d& m% T$ }) {
$ s$ L% T0 f( P m
<div class="description"><?php echo $value['name']; ?></div>
/ _5 m' J/ a! X. E<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
9 W$ [% J. r6 Q5 x6 k2 E' k; z* G2 z8 y- W1 \
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>4 J: G" e/ F. i) p4 Q8 U) w
) a7 R% a9 `, Q4 I. Y
<?php
/ ?( A$ G; [' Z: Ibreak;
7 B' m6 f7 `8 B- Lcase 'select':
) E# }8 o8 [- z# s?>9 l1 v2 Q* b/ ?: {
; G. l% K) Y$ m
<div class="description"><?php echo $value['name']; ?></div>3 J' W, S1 D2 j. @" S, r" t! ]0 v
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">- Z3 C* ]: B9 F% I
<?php foreach ($value['options'] as $option) { ?>
- k6 p6 Y; `% t( B( u<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>" o, F6 b/ Z V& W" w' @3 k T
<?php } ?>: W5 D, v: l( K0 x0 z
</select>
6 t( }% b( `" Z% X</p>
: s) P0 `9 }$ n% F4 l8 s# f; @3 W) F% X. H( v5 i+ w- Y' V
<?php
$ Z3 u* w g" }/ E) cbreak;" `1 s" [- n5 U3 ~' e; |& U
case 'textarea':
% A9 i# b) P1 ^0 S0 O' ^6 {$valuex = $value['id'];- I' H$ H1 d o. ?
$valuey = stripslashes($valuex);( F# a, f9 m* P" r# f) e* v
$video_code = get_settings($valuey);6 }6 a5 G$ w p9 \
?>
" N! F1 v! F$ _( @( H! d# ~2 U H' R3 i0 D2 x
<div class="description"><?php echo $value['name']; ?></div>- Q$ J" M% {$ Y5 [
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
+ Q" A0 g4 j9 Y
5 M# H+ b- k. e% z7 b% Celse { echo $value['std']; } ?></textarea></p>1 t: U' s, a- b0 u" i
6 v6 U6 \% J0 ~: j1 I" S4 H
<?php. a& k5 \1 Z) U
break;
/ F' @+ W6 R- b+ ]case 'close':( B r7 Z8 s. o0 a& p4 c$ a! p
?>
6 ^! f I. K5 W; r' c& |9 g6 E ?) } o5 H4 c$ S y7 t+ L) l* C
<div class="clearfix"></div>
8 c! p# z* k. p2 i- c</div><!-- OPTION SAVE END -->
6 x4 P Q- l$ S1 {, o" G* u! L* t8 t% W* _+ E8 r9 O& V
<div class="clearfix"></div>1 E V2 o) ?- W& k$ F2 f9 H* ~+ N
</div><!-- GET OPTION END -->
+ I2 B& O9 U0 A1 O) N- e$ m
$ R B& l, H8 o3 C<?php( y; a' @ K6 e# s) B, E
break;3 F& v# C# O2 \; _6 V& @
default;5 S2 g9 o$ P# V. Y* m
?> x6 u) i; m# y/ O V r: O
$ f) Z' W0 @' Z- h) h+ N2 m% S. n3 S2 g" r; x' A
<?php8 y7 s$ F4 S- l( h: y8 H, c x
break; } ?>1 ?+ U& v$ S9 w' z- j$ A$ `- t, R) j
" V" }3 Z- ~( F& F% ]1 Y L. D7 n4 {<?php } ?>* o1 l6 H$ @6 w" Q; k& @
" ?( R! i2 X% c X; R- r
<p class="save-p">
7 z; h2 q1 H/ r; T<input name="save" type="submit" class="sbutton" value="Save Options" /> j$ \" I2 O. K2 ^$ u0 C X
<input type="hidden" name="action" value="save" />/ b+ j: ^8 H1 G% r) Z6 F+ ^
</p>
; X) u+ g& H2 r0 {8 v</form>3 S, g6 f% Z# l8 t0 u8 z
, T: x h( U( {% t<form method="post">
$ q7 c* ^" R) z, E q8 A<p class="save-p">. Y: N/ Y, b# ?& P0 @: N4 G
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
! P2 j: B9 t; a<input type="hidden" name="action" value="reset" />+ R, b: r: |% u
</p>
7 P) ` m( ]0 X5 ]: F `</form>
: d/ N1 U. |1 g' N1 B3 |+ X' d% m( t0 u
</div><!-- ADMIN OPTIONS END -->4 l! C/ [/ p4 f+ |0 g. L4 `+ Z# u
1 Y: y4 l5 m; h) a<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
% g+ ^, h+ M# m
% _% Q0 Z4 v: H, Q4 e- p( Vfunction mytheme_admin_register() {, P& j# D5 x) c
global $themename, $shortname, $options;2 n* O- W! U2 V7 t. P: U$ }- l8 ?
if ( $_GET['page'] == basename(__FILE__) ) {1 W8 r7 b. b) n' i' B& M8 E
if ( 'save' == $_REQUEST['action'] ) {
- i+ C3 H7 Q- o% aforeach ($options as $value) {
% c2 E }* a( E% B# j7 Hupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
5 z: x9 K) |4 Sforeach ($options as $value) {1 v% f6 e1 l& O$ s
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }2 _& D( a, k+ A, E0 y
header("Location: themes.php?page=functions.php&saved=true");1 `0 j; r" F9 r+ N7 s- U. |" ]4 N
die;3 T' C1 n2 g" m* `9 c
} else if( 'reset' == $_REQUEST['action'] ) {4 f0 c4 i' L* ]9 m
foreach ($options as $value) {
/ U& p- D `9 L( m& ]4 v- R% W0 Ddelete_option( $value['id'] ); }# e0 ?: i9 ~6 X4 A
header("Location: themes.php?page=functions.php&reset=true");8 }' `% }, \! j8 }1 U2 Q g! J* c
die;# {# J; U- d. n0 C7 U9 d
}
1 O( S7 w5 J1 h}
5 r0 q" o2 m+ u/ }5 Z+ s# \add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');1 ^; E! e5 F" g8 G% m7 A1 ]
}, H) z: Z [$ N* R7 [! v% S
) W. F3 a2 ?' I) H' i; b7 V& n) _
function mytheme_admin_head() { ?>8 T- r( G$ k. ^- s( }4 M' Z' J
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
3 n$ r$ j. u+ v: h. }<?php }
2 T) _* t( s0 `+ A |
|