|
|

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