|
|

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