|
|

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