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