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