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