|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
% b% M; A' Q6 {3 I; S// Theme Option
; |" r6 z( m( b1 ^4 }////////////////////////////////////////////////////////////////////////////////
& `' a# E$ q, d* j" R6 t
- i* t' T S% A) k- t2 d. }: a$themename = "Zenx";
m. R# n5 K0 K1 r$shortname = str_replace(' ', '_', strtolower($themename));
' o9 H. V, d/ R% J q
0 Z: o( {5 D8 o% Nfunction get_theme_option($option)4 @) _$ Q5 k) q L7 y
{5 J R: \& ~! D! U6 y7 K# g
global $shortname;& `, Z! |, r1 K/ ?/ j) [
return stripslashes(get_option($shortname . '_' . $option));! K8 H0 `1 h: _+ L8 z
}
6 ^6 C6 z) b' o6 z' o8 M
& c, q @1 M8 Y# w, E- z1 pfunction get_theme_settings($option)
6 h9 v% Y: ]. t; p$ ?{
4 U* D5 s3 S- v5 q return stripslashes(get_option($option));
$ y: b2 M! f3 W; J8 w& Q1 q/ t}: t/ V U6 U" p& ]" U; { B4 x
$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");
5 y8 ~. t4 [5 w! E$wp_getcat = array();
) p. W% m+ G+ Cforeach ($wp_dropdown_rd_admin as $category_list) {: j7 {" I. |/ E% ^, G
$wp_getcat[$category_list->term_id] = $category_list->name;8 k, L8 s) a- S. m
}; `$ U- I3 p- x2 _
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
5 b7 M3 c# Z! G" _$ p* n5 }* k# W$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");' o1 o% Z( W" t r8 m, H" q: j1 M
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");4 G1 Z+ w9 S6 i& x6 ~# K
! m% d v: M: {: T( ~) `/ |$ n$options = array (1 E s9 f- O2 }* q3 i
& h7 Q5 H# a. ~ s/ y( L
7 t: n# ]& v7 l8 \/ h9 C array( "name" => "Blog Header Settings"," S1 ?+ @" g5 {) y
"type" => "heading",: v5 ^" S ~ a, F7 ]3 r- b
),' W1 Z' i5 m# T2 F8 u
5 l2 k U) ^2 d) ]
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",' G) w4 C* p# ?3 A9 I
"id" => $shortname."_header_logo_activate",, u1 }, t6 K* j; n6 E4 [
"type" => "select",6 j7 w' F& |; W' v- B& F
"std" => "No",! ~, G9 r1 I* G: V' I
"options" => array("No", "Yes")),
$ j* J' f3 L$ }/ ^( a7 F
2 Q: P1 T# A M9 F/ w. r% _ array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",# ^4 n) X! O2 G. n8 f
"id" => $shortname."_logo_url",
" m; ]. P5 z' A+ o- _1 M' z "type" => "text",5 K( w, ]0 d# K6 {: `
"box" => "social",
" Q- X' M3 P8 ^6 d6 K! o& f. f% b "std" => "",' T) l" t, R8 e) J! \2 t. r$ L) m
),- b* H% H* ?8 Z, {1 l
# ?2 n2 r+ ]: O$ ?3 j
array( "name" => "Insert Header Banner HTML Code (Header)
( J+ J& \1 s8 K5 l/ E <br /><em>*Recommended Size 468 x 60</em>
3 x, R% k; m" v9 X$ p' ] <br /><em>*leave blank if not use</em>",' }3 F2 @7 S/ a" f. ~4 N- G
"id" => $shortname."_header_banner",# E* ?9 j* `4 x7 ?+ l
"type" => "textarea",
$ q/ H4 S! B$ E5 w0 J- Q/ I( G "std" => "",
7 o& x* ~$ p% Q N9 e6 ~' {6 z( w9 J ),
f J0 `7 X9 q+ Q2 g. y
, F: [9 R k! t( K/ p# M, R/ d array( "name" => "</div></div>",, X* c8 l9 f$ k) y% v. `/ O
"type" => "close",- j2 I5 k5 ^& v
),
$ }0 y9 `5 ?0 L& W4 I2 D9 v6 A2 ? i6 `" ^5 R @! C: e
& T+ G# ~: n3 M array( "name" => "Header Navigation Settings",2 h) A+ k. o, l& Z6 I
"type" => "heading",
& y p5 w% o3 P* I3 x ),2 C) g7 d! u. a0 Q' f
, [5 D# |! x, L array( "name" => "Insert Page ID To Exclude On Header Navigation<br />, A2 R3 ]2 [) G7 |: B5 O5 f3 L+ g
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
. S' c4 h# }$ M5 c$ Q/ I <em>*Enter the page post ID number only</em><br />
/ w2 c7 R3 C( |/ w5 n& }% k" K <em>*separate by comma</em><br />
+ S5 o# C A6 t; u <em>*Exclude pages which you don't want to show on the header navigation</em>",9 n1 G8 n1 t/ [, q" K' p* Q
"id" => $shortname."_header_page_navigation",% k/ Z: D$ E( q# G8 t% `6 X8 L
"type" => "text",8 A, p3 _0 \4 b8 m
"std" => "",
" m( G' s9 d F/ r, o ),: k" ~; J6 \6 U5 b6 U6 A
# v* d3 o$ H4 k8 G array( "name" => "</div></div>",
/ U) `# a8 d1 Z s1 F "type" => "close",
& ?& ?* H+ }- I, {0 l ),: k% `; }/ D. e1 c) M
/ ]# r, |# c- |4 V1 S e
- M4 P( }, y, z: N) C% ^- \
array( "name" => "Post Auto Thumbnails Settings",# o9 h0 A, ?# D: |
"type" => "heading",- ~, J) K: a" S) ?9 i
),: U S$ x2 [6 c% P- g: N& d. M
+ s! _0 P6 G" h! [- Q array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 b/ o* P7 o% l, X% | "id" => $shortname."_timthumb_activate",2 r% q$ o0 {1 q1 m
"type" => "select",
( K- p! z, i. _6 Q( N "std" => "No"," L+ [7 }& k" B# U1 _
"options" => array("No", "Yes")),) A& D$ w4 B" l, X0 @
. e! G6 D6 w# i) J% ^* B
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
1 C7 z: P$ f7 q: q/ y8 J' C "id" => $shortname."_timthumb_cropping",
# Z1 j g( Y/ l( |* A "type" => "select",7 d. {- c+ K* L( E+ K) C
"std" => "",
& q+ Z* r5 K7 N9 E* ?* S9 i "options" => $crop_position),$ m% } }0 P$ P8 a
: y+ E5 S' S5 c" k/ h; U! O
array( "name" => "Insert Width Of Thumbnail Image<br />
u( B' @. f9 p$ }' [" ^ <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />7 ~/ Y* E% F' {; B( F3 j8 N
<em>*Leave Blank To Use Default: 250</em><br />",7 d/ D, H' x: B3 M! x
"id" => $shortname."_thumb_width",
$ a [7 h8 d5 c& o0 E$ q. \ "type" => "text",
/ G& U! z7 Z* R' h "std" => "",3 V# x3 k( h, s: ~+ f
),
* T2 P* ~; T8 J" K
" N) y9 }6 ]- A' ~& p; B array( "name" => "Insert Height Of Thumbnail Image<br />
' F" n i9 k8 z4 }9 i c <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
/ n" r# S2 e5 c+ d' ^- w, z o5 ^ <em>*Leave Blank To Use Default: 200</em><br />",
- m, F Y4 ^1 a! S0 u "id" => $shortname."_thumb_height",
2 B* d, F$ p3 E# _ "type" => "text",
& G( N5 [+ { E "std" => "",& P- i% V: U: `! B# [6 x
),7 u- b3 x' v7 }0 X
; u0 Q3 k1 M' d k5 ? @ array( "name" => "</div></div>",
0 N. i; j& d5 N A. F3 P. |* ? "type" => "close",
3 ~* d4 E+ X4 i; n5 \9 S& u ),
+ @+ ?: D, Y) n3 d# k
& F8 ^, w9 B. e# r array( "name" => "Featured Content Slider Settings",
& b9 W7 ?1 |* o! T5 m "type" => "heading",
# w# X$ K2 J- f# V& }6 G0 u ),4 l! o0 m1 M! ?+ L+ y! P
5 A) j: T' p* _6 k0 D0 t1 A$ `
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",1 T, e; f( s8 W' N% q1 _
"id" => $shortname."_featured_activate",- k# ^! {* @9 O, S9 n2 j
"type" => "select",
8 e7 h& _, X/ N+ I0 C& ?/ ?8 ]' I/ v "std" => "No",( g% v! @% Q7 I; p# ~& i
"options" => array("No", "Yes")),
. ^* Z% m5 c; n- y( @- ^: d& D% O1 t+ O( K$ t, q+ E I
: `' \) f1 O; ]6 s7 G5 h, X
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",; K1 t+ K8 \+ C6 [" A! J- i
"id" => $shortname."_featured_category",
- C! I! m2 c5 L0 a% } "type" => "select",
' s* x. `7 l: i* i" R& g( k "std" => "Choose a category:",
- @7 _ o T+ j- \! c8 |$ J "options" => $wp_getcat),
; y9 ? |% r/ G; K+ g4 \0 t' K6 B+ r5 v3 `
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",# x2 [2 j7 {- ~- _% F" Q7 Q
"id" => $shortname."_featured_number",
" ?* Q* t4 B# @2 [4 p$ x( i "type" => "select",$ q, K+ F% W/ D8 d
"std" => "Number of post:",2 ~' r; u5 `' t+ S- A" \
"options" => $number_entries),
9 H( k! G# Y" ~/ b2 `& D3 L3 q7 a' M7 z( u* Q' R) T
array( "name" => "</div></div>",6 Z4 A5 q7 T- |7 y4 N
"type" => "close",# N$ M8 {& v6 o. i1 Q7 ]2 ]
),1 g" B9 S8 f$ D c7 e
8 F8 R* @( A" e' B! |
array( "name" => "Featured Category Settings",
& L6 O- P3 [, k! O% Z. C "type" => "heading",4 w! Y0 {4 X. m$ [
),
1 k8 ?( R/ P) X, s7 p* M
, s4 @. p9 a5 ?/ f/ m! q7 w( P array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! E* W4 V5 M4 v# ` f "id" => $shortname."_featured_category_activate",# W4 C6 J* w7 T( y: p! d9 |5 y8 v
"type" => "select",
/ x) Q* v* W0 j; p! ^* ` "std" => "No",8 G# g, u. a4 D: a. G( u
"options" => array("No", "Yes")),% M4 r" C& I8 e+ g
* K, }- t# ], ?5 m6 k g array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",/ u! m6 a7 `0 f2 A( l: a. R7 P
"id" => $shortname."_featured_category_id1",( [- w2 _2 ~8 o# K J
"type" => "select",# d# X: c& d- I' n
"std" => "Choose a category:",8 {! a7 X4 p3 T. w9 k3 k
"options" => $wp_getcat),
: {5 v$ ^. Y+ u. \. @ * b! {% ]* u$ @& b: H3 O
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",1 b% p: y% G+ s% Z# m8 b' @( T1 [
"id" => $shortname."_featured_number1",
, P5 Z; c0 s+ c& O c "type" => "select",! X8 h, M2 g2 q$ s! {2 N! {0 B2 h0 \
"std" => "Number of post:",* G& c- J2 ^. }7 d* [" H
"options" => $number_entries)," W/ \/ W4 o+ D- @/ ]9 B
) |, u% p1 J' X array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
! h/ d7 Q4 R9 L' o7 ^ "id" => $shortname."_featured_category_id2",5 h. R' G# C4 h- t
"type" => "select",' H: |% |- b& Q2 d
"std" => "Choose a category:",
2 b7 X. _2 b2 [* b7 c, }( R "options" => $wp_getcat),* `# E* o+ Q. b2 @+ D
- ` ^* X4 K: y array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
6 d7 J; {0 V2 [" H( @3 W "id" => $shortname."_featured_number2",
d, ^2 R, u4 C% w- h "type" => "select",
3 d% w0 p' V+ ? "std" => "Number of post:",
# ?# `& Y# p5 }/ k. E "options" => $number_entries),
4 a/ v0 z: v8 |& f2 G% K S( x6 x ) m: p3 I; a* r0 F$ _
6 ^: d" A% G' q1 u( G! w array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",% _1 e9 M! {! W2 r' e
"id" => $shortname."_featured_category_id3",
- B4 \# c- P/ @% s& F "type" => "select",( u2 d5 X# D7 h
"std" => "Choose a category:",
5 G( H' }/ G! F; x& ]/ n "options" => $wp_getcat),
* b) ?/ D0 i/ R/ D1 Z7 d4 G
0 r5 L [% \! T+ x array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>", b4 f i8 J V: A4 m
"id" => $shortname."_featured_number3"," l- `" @2 @- m, `! N! Y- C# k8 \
"type" => "select",7 f7 y O0 p2 V2 s: m) V) _5 K. S
"std" => "Number of post:",
3 O4 [ ~3 b; d0 w1 K* R "options" => $number_entries),, i! M4 Y9 E. g& F1 I6 d
- D- o) W3 v. }1 [1 e
4 |( J8 b. a) E/ |" _ array( "name" => "</div></div>",) j) V0 L9 ]5 l
"type" => "close",8 p) @: U# j I5 k$ a
),
& I& A* O3 a; [, J; A, |3 H3 o; L
& h( s8 \' [! W+ a n' M# ^1 B; f6 G m
array( "name" => "Google Adsense & Analytics Settings",
- |8 R% R* c. n9 Q0 G) L5 A "type" => "heading",
6 X. L4 R' h$ h+ E+ t4 N ),) a1 [, I x; ] ~3 S f9 {
$ m3 {0 k0 Z7 ^' e/ Z! T/ u
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",5 l9 J2 t4 A. ~
"id" => $shortname."_adsense_loop_activate",1 ~ I! l0 k0 z
"type" => "select",
# U' x5 \* {+ j "std" => "Disable",* c3 g$ N7 t: r, r; d5 K! P, V) Q* V+ x# t8 I
"options" => array("Disable", "Enable")),5 F$ s: t: p6 `+ i( R6 Z2 ]
3 G+ y2 a: \; v' P M% h0 s1 L6 \ L
array( "name" => "Insert Google Adsense Code For Loops Here<br />! s, \* R; Z. J. ?
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",% d$ j* F0 A. @ C- E6 [
"id" => $shortname."_adsense_loop",: o. [& d3 Q* I/ d8 d
"type" => "textarea",2 J% A6 w; f: v
"std" => "",
4 z' k: N6 M% r7 H* v5 v1 o7 c! U ),
$ d" R7 d/ v% ~( d
: k6 {7 J4 \. @6 m6 k. Z( j! J" h array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",$ ?+ ^( c$ r5 Q3 c6 X
"id" => $shortname."_adsense_single_activate",5 S9 X5 Z$ R7 J; d
"type" => "select",2 w" t* H$ w9 _4 N- i: H/ a# l4 C5 {
"std" => "Disable",
0 T- x( T( V' f3 U "options" => array("Disable", "Enable")),
F% Z+ f+ c. P2 x1 h; O
* K. f5 ?' V' W array( "name" => "Insert Google Adsense Code For Single Page Here<br />
7 x4 F) V6 k9 D0 Q! Y( m% E <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",; I( P# q: J: ^
"id" => $shortname."_adsense_single",
# T# o. V9 j5 z E3 V* p "type" => "textarea",5 _; o# N0 s2 b- q6 f. Z" [. }
"std" => "",
w( c- n7 \ U0 H/ u ),) x! P: V* R0 O4 h; D
" B* P' @0 E' J* I+ a
& J8 U0 m( d. |5 E7 e array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
3 J/ W8 j! h9 G) O "id" => $shortname."_google_analytics",
/ W. j( v5 ?9 D/ y "type" => "textarea",: O, ^9 f6 s' Q) U( B$ _- m$ u
"std" => "",
) G7 C6 D2 a+ q2 I/ U$ s8 m ),
+ S7 t$ c4 Y" u8 j7 M
. a" c( s, J7 [! G+ E0 O6 x array( "name" => "</div></div>",6 n# G1 w) @6 P8 U( i
"type" => "close",( b" X" s/ K7 u: O, t2 Z
),
) \0 y+ _0 n& [$ J : M0 l% \1 w7 M$ a
+ B, R- J/ T( k% f2 \/ j S7 `0 G, c
array( "name" => "AddThis Social Bookmarking Settings",
, Y3 `$ |+ K! E3 X" c$ a# i0 h "type" => "heading",6 _# o* m! P* @' m, L8 D) H4 H
),- Z1 V4 F% J- E& k$ B! s
( [8 @/ h$ x% {: D+ d# G array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
4 `: u# o: _0 R/ K3 n# p+ m! T& g <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
% h$ z0 P& r5 D+ A2 [& Q! D "id" => $shortname."_addthis",
, Q3 d4 u* Y! `$ Q "type" => "text",
- G9 ]8 Z7 n/ N "box" => "social",
* M* r" s, e# y. m6 m/ \ "std" => "",7 S8 H* v4 O z6 L2 ~
),5 p4 J5 L1 T, y/ S a4 I2 B1 h/ |% `
$ g6 U) m1 p+ |2 y: X array( "name" => "</div></div>",
, ^1 } W7 U( |7 G6 T "type" => "close",
' b+ G+ h0 G1 ?3 j1 t/ B1 ] ),
) Z5 W" v r2 `3 k( ]0 [5 p# ~, N
) c# z% d. F8 r+ G* x9 R
' Z) [( t) b! n6 j
2 J: V u& M% z array( "name" => "YouTube Video Settings"," I( t# [' }2 c/ |" S
"type" => "heading",* ^: E9 C9 N8 _9 v: H1 S, o y! O
),; p0 B% M8 l6 k0 K( L* F
5 A$ W% I+ P- e" I1 K" v. Z) E0 } array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",* D/ N" v; p- H& Y \
"id" => $shortname."_emvideo_activate",
3 Q, S7 N3 p- w1 W$ s+ l "type" => "select",
: A+ w* u; ]9 W! Q "std" => "No"," r* \# s* } c* H; {3 u Y3 {
"options" => array("No", "Yes")),4 E+ q4 y6 x$ |: P9 W
6 u8 y3 r+ m2 i6 z' z
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>",
# d1 f: a1 A% ~' W( w" Q "id" => $shortname."_emvideo",
, \- Q3 E4 u5 _1 @1 i "std" => "",6 A- j, m+ k+ V- M6 K
"type" => "text"),: Q8 a( [, q7 ]" A
: ?) _5 `/ Z6 R( b array( "name" => "</div></div>",
, D: b, ^7 A9 G" } "type" => "close",) p. B8 {" U' }$ z3 C
),& u) u4 G" j2 G% e3 v
, X, Y$ y; P' g2 S2 ^, F array( "name" => "Twitter Settings",; ^2 T; y& b( r' n9 H9 B
"type" => "heading",
) t' a) m. r0 m ),
! @7 k5 f+ q5 O4 U
7 X9 K* ]8 }! ^8 m array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",) q& p# H. U- f4 w( a
"id" => $shortname."_twitter_activate",
7 Y+ S$ f8 A7 C d0 \% M; i "type" => "select",* Q" v. W: X9 \- }1 j
"std" => "No",
3 p, P4 o) T6 b* C "options" => array("No", "Yes")),2 f, n; Q" y' q' K; O' R" ?
- }" ^5 {& n" p& r8 j( m
array( "name" => "Insert Your Twitter ID here! U3 Y+ _% N% R; G* H1 k& l- r! X" s
<br /><em>*leave blank if not necessary</em>
$ g4 K% ~% u5 F" V <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
, U' u& _9 z' _ "id" => $shortname."_twitter",! t6 T- J) w6 |
"type" => "text",9 b7 \4 C* E% h! U
"box" => "social",
. u& C' u( \$ E$ B' g! Z "std" => "",
7 `- s/ U- G3 Y2 \. w( @ ),: H% {+ V! t; f. F9 w( m$ a. [6 l3 Y
5 O' F0 B3 I/ |9 T# v! m$ K" M array( "name" => "Enter Twitter Feed Count here- _5 `! m: h% a: J- P# S* i
<br /><em>*leave blank if not necessary</em>. \: x/ U; G3 |" ~6 |6 B1 _
<br /><em>*Enter How Many Twitter Feed To Display</em>",
{4 e A$ b; ]& P3 w0 U' m "id" => $shortname."_twitter_count",
. u5 L& E3 S" E% [ "type" => "text",$ W' X. u E$ ^" m
"box" => "social",
1 [- F7 B& n7 ~) T "std" => "",6 ]: {5 z) E: ^
),
$ H7 W! G, h [0 f& N" V. S3 c
) _4 ?3 ^ C3 f8 `) j array( "name" => "</div></div>",5 H# a& D/ K4 s7 W4 ^6 r* e9 Q
"type" => "close",
5 A0 v8 k# R, w: ?# G# Z ),) v9 R4 y$ B0 b1 V% [5 G
6 O" n+ \* r# I& y/ ]. M" \
; b! b; o+ k B array( "name" => "125 x 125 Banners Advertisement Settings",
; Z8 N" L( \5 ]4 H% q- ]4 x "type" => "heading",, o5 D0 [) u% t+ D
),' c' y/ L) v) A$ p1 S
/ [% R; P9 q2 g
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& E& z$ X( r5 h8 L$ g) { "id" => $shortname."_sponsor_activate",
: P3 Z0 b' E" y- _: O M. K: M "type" => "select",* Y7 `: z3 W/ y2 U% j' n. s
"std" => "No",$ j2 N8 s [& [4 @: R( o$ L
"options" => array("No", "Yes")),
7 m1 w0 o. ~, r7 C6 j0 C, g) O# A {
8 F B# R! u: M- M7 P' O$ ^9 n& d* _3 w; R- o$ y# N p
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
% x2 P2 t. ?: J0 [% I' I0 u "id" => $shortname."_sponsor_banner_one",
& ~: V0 d5 X T5 m: W "type" => "textarea",+ h" t' Y9 y. {7 |
"std" => "",
0 N# {1 _( V4 |/ P% k Y9 v ), 1 n9 y6 q+ R. A- B5 l
1 A7 X; u1 n& i
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
* C' I; W: v' n/ a$ ]: { "id" => $shortname."_sponsor_banner_two",% j5 a2 g! i8 C4 f: E+ N* L' j
"type" => "textarea",
) B, L0 R4 m, V5 J# \6 s, p6 I "std" => "",
# o: ?1 H1 |. n2 [$ a# O5 | ),5 y( o+ D5 r4 w/ L, G; z7 w
. g9 A" `7 Y* l* k( y# }: ?
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",$ I) ~# Z$ k, ^1 ?3 J! z5 v6 S
"id" => $shortname."_sponsor_banner_three",% m2 X. H8 @" v' d' d% y) ^- ]
"type" => "textarea",& R# I/ x* [1 V- w1 q/ f
"std" => "",
, Q6 O- |1 L& C8 E ), c8 j1 m' Q! U+ H
0 j! N5 n6 Q7 d2 D, Q& Q array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",7 A d9 ?( ?' `2 c8 [2 C
"id" => $shortname."_sponsor_banner_four",
% B4 z9 b" l# r+ b1 M "type" => "textarea",6 L$ y2 {/ B1 l. Z$ F+ J& Y
"std" => "",2 [7 x2 V7 {) e1 {9 L
),
2 X. j0 e3 @1 n% y
^, ^8 F, F: y' ]0 i; u5 P6 u array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
6 u6 N) b, |" s9 f3 J "id" => $shortname."_sponsor_banner_five", ~; y8 s3 ?: v. @
"type" => "textarea",
( o" t8 t+ {) ?5 t f" i "std" => "",) P* q+ a# F6 V# u
),( y' k, ?, b/ S v. c' R
1 n% U+ m V6 \5 O& p1 g4 P; i
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",! u' ^: _' A; t1 F: D2 P: i1 T
"id" => $shortname."_sponsor_banner_six",
& a* l6 R5 L( Q/ M' B! x, y "type" => "textarea",
" J( t o1 S' J1 A) c: F( b "std" => "",% F6 Z8 k, B4 T9 c
),2 _4 [$ L0 X8 U5 j6 S$ @
, i) s8 u5 x4 x0 u array( "name" => "</div></div>",3 e' I6 G0 ~& C2 H- O, n1 Y
"type" => "close",
- L. t( C4 m" W; g ),- }% t/ d5 W( T' ?& p1 j& M1 ]
( e9 B3 M# V8 k9 Y; S2 V: B+ L+ X* ?* Q; r; U' U/ x' X
3 r" G# O) B7 H0 N# A+ r. |);
I4 q) E9 ?4 L( ^' T: B" s' ?/ m) ~& T
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {# [* j) H- [( s! f* d. t
: {* X. \# I' ]4 h' N R
echo "<div id=\"admin-options\"> ";
1 m% ^* I' V* u4 Z1 |1 _3 Q7 M0 X" {+ |
global $themename, $shortname, $options;) N* J2 k; A m2 p B5 a5 x
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
+ b: k# k% T% H9 p0 Kif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';2 p) y6 Z+ ~1 V' }7 l9 U2 P
?>
. L ?1 k( d* s
- }8 S+ E/ @8 Z# @0 P1 S( ^( P$ [<h4><?php echo "$themename"; ?> Theme Options</h4># k3 C7 g) L( }( N
1 m& W! T5 b! f( }/ i<div class="annouce">. |' r1 j7 A6 \: ~) P2 y7 {- v
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
( J- p5 z( j8 T1 @/ Q, W<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>
- N5 l2 e$ D x& s0 `& P; w- y</div>5 S- R" w7 S; Q- C2 g0 X- c0 B4 Q
6 ?! z0 C& G( b; H. k; L
<form action="" method="post">/ Z8 y2 G9 q7 V: n V, \$ a) r, I; A
' T1 k) Z" D1 j& i7 d- k<?php foreach ($options as $value) { ?>
% z4 y& E2 E1 S* D
! x0 g8 o! B1 ?3 e<?php switch ( $value['type'] ) { case 'heading': ?>
/ ?+ w6 A6 n7 F+ B! B- _% d$ ^! I" C. q$ |
<div class="get-option">2 i: Z3 ~ `; o
: _) C. z# l1 V
<h2><?php echo $value['name']; ?></h2>
! |1 y6 R2 o+ w& | q$ j" i
+ u5 v j4 T! _ L; w<div class="option-save">& S: m# r8 p. R- { G. ]
1 _5 S7 }$ x+ V2 k; F F1 B<?php
% Q- H. k7 J! b B- _7 @; bbreak;
% @* F( l& q* H* U1 qcase 'text':
, g$ E1 K/ u/ u4 C( x5 Y- l7 n, ^' u?># H; Z5 M" Z( V
% z+ F4 k6 u ~+ Q, j( V<div class="description"><?php echo $value['name']; ?></div>
6 M& Z0 o" [2 L) v<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
; p" r, D- i2 J$ _3 t9 f3 ^4 Y$ Z# J( O" \
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>% X, h$ G! K9 ?6 c9 c0 z
, j% \$ G) @9 R1 s4 [7 S
<?php
' G1 C4 e7 e$ g5 t) \% s1 Y- ~7 Vbreak;
# J, T I* X2 T* ~! rcase 'select':
) Z. H: Z2 h7 ~+ u+ T?>" u$ o" }8 G- f+ H; }2 J) U
3 b5 a% I3 E3 M1 T7 m
<div class="description"><?php echo $value['name']; ?></div>
* X m7 {& P$ U. O/ T: T( S<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
( P/ K5 L) _( t I+ c( ]<?php foreach ($value['options'] as $option) { ?>& @+ v" V8 Z! Q
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
- x+ I" k3 A1 j+ _/ R$ b<?php } ?>
1 |1 V! J6 n! j. v5 [) n/ f</select>* U3 `; c2 _3 l; }* M
</p>+ o8 J! @0 C2 j$ ^% w/ I
- Y k! \* r8 ~4 i9 N3 V9 d+ z
<?php9 p) L/ Q/ J5 ~) K6 V* Z
break; r `, G5 L/ l/ [* R
case 'textarea':
! h0 \- |) G9 B* y! v) O5 D8 c$valuex = $value['id'];% O" o0 n! K9 I" z1 r
$valuey = stripslashes($valuex);6 V9 _0 k1 O" T7 e k8 Z
$video_code = get_settings($valuey);
0 @1 G* K# z* x/ l+ |4 u?>
( ~8 M0 |, c! K# v; Z- ^$ }- b
3 R4 s2 j, x k" n0 b5 v<div class="description"><?php echo $value['name']; ?></div>
2 [1 Q" D& e) a2 M5 s<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
9 ^# }& T* s2 |( y+ K
}2 D6 S2 u$ d4 \" z! I. Qelse { echo $value['std']; } ?></textarea></p>
8 d6 H9 N, f; }* _. e
1 k2 i) u) R; J, A; ~9 N) \<?php
: \+ j# T( q! N! H7 q, _break;
# T$ v. k/ j k: g: zcase 'close':
9 z% K( a* `, l. r* E' Y?>% j& t6 d* d4 q% J; ^0 ~! H
. l. A$ u) q0 y
<div class="clearfix"></div>
~5 k$ g; ?/ D$ a# z</div><!-- OPTION SAVE END -->9 A" ^1 J O! q
% d# j# y* ]% m$ P<div class="clearfix"></div>. V2 r3 ]& x* E
</div><!-- GET OPTION END -->
4 x* j0 U* U6 l- \% F' n- a, F- o7 N+ u# v# F3 s1 Q
<?php( A2 @& i$ H) F2 b/ o. ^
break;
2 d, C/ u4 g1 L8 w+ A. P! l7 ~default;) R6 N" Y: p8 i: t
?>6 Z; a: d0 A! r2 U6 g
9 c4 T+ R: t4 L7 x4 H
" ?$ g6 |) p! \4 [4 h<?php6 \- n' I4 n0 l$ ? C, l$ I. T
break; } ?>
2 X$ ?- S4 J7 M9 Q! k+ X) i% ^. O9 T+ J- Z( F& Q) ?
<?php } ?>
+ Z4 ~% e2 W+ P/ G
) @% D2 F3 i& G& U1 T' a) ?<p class="save-p">: k N* v' z1 r
<input name="save" type="submit" class="sbutton" value="Save Options" />3 f+ a5 R( i7 h0 U8 \! m3 \
<input type="hidden" name="action" value="save" />6 g+ F6 U. G. r+ J+ Z
</p>7 Z( A f3 j! B+ z; ~0 f
</form>
) Q) D+ c! U) m" X4 D$ x5 U. v- `& k4 q- `2 {" O
<form method="post">
I6 D0 [0 S3 Y! y<p class="save-p">: W& s: v- w" N- p, a& G Y: [* P
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
! S$ V$ y0 }* z Q. F<input type="hidden" name="action" value="reset" />
2 c6 U3 U8 L# U0 {3 I# K</p>; {! ~ F" s4 F; \
</form>
. ]' p% [4 }* N: I* @8 z* b9 ^
: p& a: v/ z: m# [$ [& m</div><!-- ADMIN OPTIONS END -->
, P3 z) Y* h' [8 t
9 Q+ V( q g! W1 b+ L<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
6 W0 Q! c3 a$ I2 ^4 Q: g+ o) {8 {; y- T2 c& _: G- p
function mytheme_admin_register() {
: b# p4 ]8 S5 I3 K! n l% ?. gglobal $themename, $shortname, $options;1 r) q- Q' J+ i. t
if ( $_GET['page'] == basename(__FILE__) ) {/ V+ I9 J( m6 K0 r
if ( 'save' == $_REQUEST['action'] ) {) A/ Z( I! w) f6 z8 w
foreach ($options as $value) {0 E" p9 t6 R" M% ]) H# v( m
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }, e4 f6 L1 K2 ~. x7 p
foreach ($options as $value) {
+ R, J! V2 ?; T+ }) D9 Z; Kif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
* n6 U1 Y0 m+ h+ P& Pheader("Location: themes.php?page=functions.php&saved=true");
2 d |. _3 b4 O* K- F( ~* }die;
l. t: u7 U4 S0 S8 A} else if( 'reset' == $_REQUEST['action'] ) {* j0 ^5 b1 m: O4 `9 h4 D
foreach ($options as $value) {
: j/ z) _$ p* V- I1 Kdelete_option( $value['id'] ); }
. u. J3 T: X7 E; U' Y% R3 B7 lheader("Location: themes.php?page=functions.php&reset=true");
, G- A0 P' b5 [5 U; N* zdie;& H8 `4 k; A; g& E/ Q, x
}' S$ e. [) l2 p4 ]4 v& d! `' G
}
7 h& C3 R1 w' y: y z3 [& [% [add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
2 y+ d: l8 x+ x" V& M* l0 Z! S}
# S( ~2 b2 e5 C+ q- K8 \4 v' I& t/ r8 j( O: v- X( B8 F1 `
function mytheme_admin_head() { ?># ^4 @1 \& G( n* W- y. @9 ^
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
0 G) {" l% ?! y+ V" F<?php }3 |. g ]: r; S, v: S) Z- a
|
|