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