|
|

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