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