|
|

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