|
|

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