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